»
EnglishFrenchVietnamese

Print - Mail It - JavaScriptBank.com

Full version: jsB@nk » Email » Mail It
URL: https://www.javascriptbank.com/mail-it.html

Mail It © JavaScriptBank.comThis JavaScript create a feedback form. You can combine this JavaScript with the other languages as PHP, ASP,... to create contacter for user.

Full version: jsB@nk » Email » Mail It
URL: https://www.javascriptbank.com/mail-it.html



JavaScript
<script Language="JavaScript"><!-- hide script from non compliant broswersfunction mailIt(form) {var data = document.dataFormvar userInfo = ""// comment out the next line if you want to hardcode the recipient// then add 'bob@home.com' to the 'mailform' action attribute// (i.e. -- ACTION="mailto:bob@home.com")form.action += data.recipient.value// comment out the next line if you want to hardcode the subject// then add '?subject=example' to the'mailform' action attribute.// You must hardcode an address before you can hardcode a subject.// (i.e. -- ACTION="mailto:bob@home.com?subject=example")form.action += "?subject=" + data.subject.valueuserInfo += "Page Title:  " +document.title + "\n"userInfo += "Mailed From: " +document.location + "\n\n"form.mailBody.value =userInfo + "\n"+data.name.value +"\n"+ data.country.value + "\n" + data.email.value+ "\n"+data.comments.valuereturn true}// end hiding from non compliant browsers--><!-- http://www.a1javascripts.com --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<table><form NAME="dataForm"><!-- DELETE THIS TABLE ROW IF YOU'RE HARDCODINGA RECIPIENT --><tr><th ALIGN="right">Recipient:<td><input NAME="recipient" SIZE="40" VALUE=""></tr><!-- DELETE THIS TABLEROW IF YOU'RE HARDCODING A SUBJECT --><tr><th ALIGN="right">Subject:<td><input NAME="subject" SIZE="40" VALUE=""></tr><tr><th ALIGN="right" VALIGN="top">Your Name:<td><input NAME="name" SIZE="40" VALUE></tr><tr><th ALIGN="right" VALIGN="top">Country:<td><input NAME="country" SIZE="40" VALUE></tr><tr><th ALIGN="right" VALIGN="top">Email:<td><input NAME="email" SIZE="40" VALUE></tr><tr><th ALIGN="right" VALIGN="top">Comments: <td><input NAME="comments" SIZE="40" VALUE></tr></form></table><form NAME="mailForm" ACTION="mailto:" METHOD="post" ENCTYPE="text/plain" onSubmit="return mailIt(this)"><input TYPE="hidden" NAME="mailBody" VALUE><tr><td COLSPAN="2" ALIGN="right"><input TYPE="submit" VALUE="Send My Email Now"></tr></form></table><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->