Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Would this work?

<input type="text" value="<a href=jroq@gmail.com>JROQ</a>"></input>

How could I make it happen?

share|improve this question
add comment

1 Answer 1

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:

  1. 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>

  2. 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.

  3. 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)

share|improve this answer
    
Good sir, the reason why I want to do this is to implement it in a messaging service. I would want to do it like this: support.gfi.com/manuals/en/faxmaker/fax14user/images/… See the "To:" part? Now I would do it in Javascript and PHP, get the strings in the textbox separated by a ';' then parsing it and checking the names against the emails in the database but it would result in duplicate values if there are two names alike. Isn't there any other way? –  J Roq Aug 24 '11 at 3:17
    
Would this work, what if I use parallel arrays and add to the first one the name then on the other one the email, then if I will send the message I'll use the array of emails? That way all I need to edit is text. To give you a great example of what I'm trying to achieve, here in StackExchange if you post a new question, the tags textbox does what I want to do. How will I do that? –  J Roq Aug 24 '11 at 3:25
    
If you're trying to make a web page that looks like that screenshot and sends emails then there isn't a whole lot to it. You would use a regular HTML form to capture the email information (recipients, subject, message, etc) and then use whatever server side programming language you prefer to process it. I can't explain the details of how to do the programming as it is beyond the scope of this website. But if you need help coding you can ask at StackOverflow. Just be sure to show what work you've done and ask specific questions or else your questions will be closed. –  John Conde Aug 24 '11 at 3:54
    
Thanks good sir, but I would have thought all web questions go here. Once again, thank you! ^^ –  J Roq Aug 24 '11 at 3:57
2  
Programming specific questions belong at StackOverflow and more general website operation questions belong here. There is some overlap but that's basically how it works. –  John Conde Aug 24 '11 at 4:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.