»
Tiếng AnhTiếng PhápTiếng Việt

In - Form gửi thư hồi âm 1 - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Email » Form gửi thư hồi âm 1
URL: https://www.javascriptbank.com/mail-it.html

Form gửi thư hồi âm 1 © JavaScriptBank.comHiệu ứng tạo một biểu mẫu hồi âm được soạn sẵn có hiện trước địa chỉ thư điện tử người nhận và tiêu đề thư. Bạn có thể dùng biểu mẫu này kết hợp với các ngôn ngữ lập trình web phía server như ASP, PHP, JSP,... để tạo form liên lạc trên site của mình.

Phiên bản đầy đủ: jsB@nk » Email » Form gửi thư hồi âm 1
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-->