: Is it possible to have a link inside a textbox like Outlook (names of the recipients) Would this work? <input type="text" value="<a href=jroq@gmail.com>JROQ</a>"></input> How
Would this work?
<input type="text" value="<a href=jroq@gmail.com>JROQ</a>"></input>
How could I make it happen?
More posts by @Michele947
2 Comments
Sorted by latest first Latest Oldest Best
<!DOCTYPE html>
<html>
<script language="javascript">
function Reload() {
window.location.reload();
}
function NewWindow(mypage, myname, w, h, scroll, statusbar, tool, menu, location) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +',scrollbars='+scroll+', status='+statusbar+',toolbar='+tool+', menubar='+menu+', location='+location+',resizable=no';
win = window.open(mypage, myname, winprops);
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus();
}
}
</script>
<script language="javascript">
function Close()
{
self.close();
if (opener && !opener.closed)
{
opener.Reload();
}
}
</script>
<body>
<input type="text" style="cursor:pointer;color:blue;text-decoration:underline;" name="orgurl" size="30" tabindex="2" value="http://url" onClick="javascript:NewWindow(this.value,'name','1100','900','yes','yes','yes','yes', 'yes')">
</body>
</html>
Yes and no. Yes, because the value attribute can accept any string (although you really should use HTML entities for the < and > characters) so you could pass that string to the recipient of the form submission. No, because if you are trying to make an actual hyperlink that is not valid HTML.
It also begs the question: why would you put a hyperlink in an input field? If you're trying to send an email from your webpage there are plenty of ways to do it. You can:
Use mailto: in the hyperlink to call the default email program on the user's computer to sent the email: <a href="mailto:jroq@gmail.com">JROQ</a>
Use a <form> to capture the form information and then send it to a server side script written in the language of your choice so it can send the email for you.
Set the action attribute of the <form> element to be the email address you wish to send the email to: <form action="mailto:jroq@gmail.com"> (be prepared for ugly emails, though)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.