function check_feedback(theform) { if (jtrim(theform.name.value) == "") { alert("please fill name!"); theform.name.focus(); return false; } if (!isemail(theform.email.value)) {theform.email.focus();return false;} if (jtrim(theform.title.value) == "") { alert("please fill the feedback topic!"); theform.title.focus(); return false; } if (jtrim(theform.message.value) == "") { alert("please fill the remarks contents!"); theform.message.focus(); return false; } return true; } function check_leave(theform) { if (theform.name.value == "") { alert("please enter your name!"); theform.name.focus(); return (false); } if (!isemail(theform.mail.value)) { theform.mail.focus(); return false; } if (theform.mess.value=="") { alert("please enter your message!"); theform.mess.focus(); return (false); } if (theform.code.value=="") { alert("please enter the code!"); theform.code.focus(); return (false); } } function check_regedit(theform) { if (theform.user_no.value == "") { alert("please fill the member id!"); theform.user_no.focus(); return (false); } if (theform.user_password.value == "" || theform.user_password.value.length < 6 || theform.user_password.value.length > 12) { alert("please fill the password , the password length should 6-12 !"); theform.user_password.focus(); return (false); } if (theform.confirm_password.value == "") { alert("please fill the reenter password!"); theform.confirm_password.focus(); return (false); } if (theform.user_password.value != theform.confirm_password.value) { alert("two password inconformities!"); theform.confirm_password.focus(); return (false); } if (!isemail(theform.user_companyemail.value)) { theform.user_companyemail.focus(); return false; } } function check_job(theform) { if (jtrim(theform.name.value) == "") { alert("please fill in contact name!"); theform.name.focus(); return false; } if (jtrim(theform.sr.value) == "") { alert("please fill in the date of birth!"); theform.sr.focus(); return false; } if (jtrim(theform.tel.value) == "") { alert("please fill in contact phone!"); theform.tel.focus(); return false; } if (!isemail(theform.email.value)) { theform.email.focus(); return false; } if (jtrim(theform.lx.value) == "") { alert("please fill out the address!"); theform.lx.focus(); return false; } return true; } function check_stock(theform) { if (jtrim(theform.contactperson.value) == "") { alert("please enter your name!"); theform.contactperson.focus(); return false; } if(!isemail(theform.email.value)) { theform.email.focus(); return false; } return true; } function check_product() { for (var i=0;i 100) { window.alert("email address length can not be more than 100 !"); return false; } var regu = "^(([0-9a-za-z]+)|([0-9a-za-z]+[_.0-9a-za-z-]*[0-9a-za-z]+))@([a-za-z0-9-]+[.])+([a-za-z]{2}|net|net|com|com|gov|gov|mil|mil|org|org|edu|edu|int|int)$" var re = new regexp(regu); if (s.search(re) != -1) { return true; } else { window.alert ("please enter a valid e-mail address !") return false; } } function jtrim(str) { var i = 0; var len = str.length; if ( str == "" ) return( str ); j = len -1; flagbegin = true; flagend = true; while (flagbegin == true && i< len) { if (str.charat(i) == " " ) { i=i+1; flagbegin=true; } else { flagbegin=false; } } while (flagend== true && j>=0) { if (str.charat(j)==" ") { j=j-1; flagend=true; } else { flagend=false; } } if ( i > j ) return ("") trimstr = str.substring(i,j+1); return trimstr; }