Phiên bản đầy đủ: jsB@nk » Email » Trình gửi email đơn giản
URL: https://www.javascriptbank.com/form-validator.html
Hiệu ứng là một trình gửi thư điện tử dạng đơn giản.
Phiên bản đầy đủ: jsB@nk » Email » Trình gửi email đơn giản
URL: https://www.javascriptbank.com/form-validator.html
<SCRIPT>function validate(){var err;err=0;{if (document.FB.Name.value=="") {document.FB.name_E.value = '*ERROR:Please enter your name';err=1;return false}else document.FB.name_E.value = ''; if (document.FB.Email.value.search("@") == -1 || document.FB.Email.value.search("[.*]") == -1){document.FB.email_E.value = '*ERROR:Please enter a valid e-mail address';err=1;return false}}if (err==0) document.write('<center><font color=red size="+2" >Ok!Data sent!</font>');//Please remove this when you fill the "action" field on your FORM}</SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<FORM name=FB onsubmit="return validate()" action=""><TABLE cellSpacing=0 cellPadding=4 width="69%" border=0> <TBODY> <TR> <TD align=left> <TABLE cellSpacing=0 cellPadding=4 border=0> <TBODY> <TR> <TD align=left></TD></TR> <TR> <TD><FONT face=tahoma,arial color=navy size=2>Your Name</FONT> </TD> <TD><INPUT style="FONT-SIZE: 11px; WIDTH: 200px; COLOR: navy; BACKGROUND-COLOR: orange" onfocus="document.FB.name_E.value = ''" size=15 name=Name> </TD> <TD> <INPUT style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: 11px; BORDER-LEFT: medium none; WIDTH: 200px; COLOR: red; BORDER-BOTTOM: medium none; BACKGROUND-COLOR: white" size=15 name=name_E> </TD></TR> <TR> <TD><FONT face=tahoma,arial color=navy size=2>E-mail :</FONT> </TD> <TD><INPUT style="FONT-SIZE: 11px; WIDTH: 200px; COLOR: navy; BACKGROUND-COLOR: orange" onfocus="document.FB.email_E.value = ''" size=15 name=Email> </TD> <TD><INPUT style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: 11px; BORDER-LEFT: medium none; WIDTH: 300px; COLOR: red; BORDER-BOTTOM: medium none; BACKGROUND-COLOR: white" size=15 name=email_E> </TD></TR> <TR> <TD colSpan=2><STRONG><FONT face=Tahoma color=#000080 size=2>Your comments:</FONT></STRONG><BR><TEXTAREA style="FONT-SIZE: 11px; WIDTH: 300px; COLOR: navy; FONT-FAMILY: tahoma,arial; BACKGROUND-COLOR: white" name=Comments rows=7 wrap=VIRTUAL cols=30></TEXTAREA> </TD></TR> <TR> <TD> <INPUT style="FONT-WEIGHT: bold; BACKGROUND: orange; COLOR: white" type=submit value=Send name=submit> <INPUT style="FONT-WEIGHT: bold; BACKGROUND: orange; COLOR: white" type=reset value="Reset " name=reset> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->