Online Shopping : Computers : Programming : Languages : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 18 people (72%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Can I use JS to 'submit' an HTML form MAILTO: wise

Feb 3rd, 2005 04:42
Stoyan Stefanov, Nick Hearn,


To submit this simple form:
<form name="automailto" action="mailto:[email protected]" method="post">
    <input type="text" name="test" value="Some text here" />
</form>
... anywhere on the page you can use something like:
<a href="javascript:document.forms['automailto'].submit()">mail me that
form, pleese</a>
Of course in order for this to work, your site visitors have to have an
email client setup and they'll have to "say" OK to the prompt that
advises them that this form is being submitted by email. If you want to
workaround these restrictions you can use a server-side (PHP, ASP,
whatever) mailing script and submit the form to it.