日期:2014-05-16 浏览次数:20371 次
function check(){ var xing = document.frm.name.value; var ming = document.frm.name_c.value; var email = document.frm.email.value; var email2=document.frm.c_email.value; var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA -Z0-9]+\.[a-zA-Z]{2,3}$/; var tel = document.frm.tel.value; var school = document.frm.school.value; var special = document.frm.special.value; var major = document.frm.major.value; if(xing =="" || ming ==""){ alert("please input name"); return false; } if(email =="" || email2 == "" || email !=email2 || !myreg.test(email)){ alert("please input email"); return false; } if(tel == ""){ alert("please input tel!"); return false; } for(i=0;i<tel.length;i++){ if(tel.charAt(i)<'0' || tel.charAt(i) > '9'){ alert("tel must be number!"); return false; break; } } if(tel.length !=11){ alert("tel number must be 11 ") return false; } if(school =="" || special =="" || major == ""){ alert("please input school or speciality or special"); return false; } return true; }