View Code
1 function checkEmail() {
2 var checp = document.getElementById("ctl00_ContentPlaceHolder1_txtP_EMAIL").value;
3 var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
4 if (checp != "") {
5 if (!myreg.test(checp)) {
6 alert('請輸入有效的E_mail');
7 closeMessage();
8 return false;
9 }
10 }
11 return true;
12 }