function rep(the) { var i; var theform; for (i=0;i<(the.all.length);i++) { theform=the(i); if (theform!=null) theform.value=theform.value.replace(/'/g,"''"); } } function frmform1_onsubmit() { rep(frmform1); if (frmform1.contactor.value =="") { alert("聯系人不能為空"); frmform1.contactor.focus(); return false; }else if (frmform1.telenumber.value =="") { alert("電話不能為空"); frmform1.telenumber.focus(); return false; }else if (frmform1.email.value =="") { alert("Email不能為空"); frmform1.email.focus(); return false; }else if ( CheckEmail(frmform1.email.value) == -1 ) { alert("Email格式不正确"); frmform1.email.focus(); return false; }else return true; } function CheckEmail(str) { re = /^[ ]*[A-Za-z0-9_-]+@{1}[A-Za-z0-9_-]+(.{1}[A-Za-z0-9_-]+){1,3}[ A-Za-z0-9_-]*$/; r = str.search(re); return(r); }
|
||||||||
|
||||||||
|
|
|
|||||||
|