/*****************************************************************/ /* Validation of the login and the password */ /* Login can be either A-Z characters and numbers or email */ /* passsword can be only characters and numbers */ /*****************************************************************/ // Returns true if the string contains quotes function fnCheckQuotes(strPw){ if ( strPw.indexOf('"') != -1 || strPw.indexOf("'") != -1) return true; return false; } // returns true if form valid for sumbission function fnValidate(oform) { var sLgn = oform.loginName.value if (sLgn == '' || sLgn == '用户名' || fnCheckQuotes(sLgn)) { alert("请输入正确的用户名。"); oform.loginName.value = '' oform.loginName.focus(); return false; } var sPsw = oform.password.value if (sPsw == '' || fnCheckQuotes(sPsw)) { alert("请输入正确的密码。"); oform.password.value = '' oform.password.focus(); return false; } return true; }
![]() |
![]() |
![]() | |
|