登录代码
验证用户登录信息 <script language="JavaScript"> <!-- function validateLogin(){ var strUserID = document. frmLogin. txtUserID.value; var strPassword = document. frmLogin. txtPassword.value; var primeInUserID= document. frmLogin. txtUserID.value.indexOf("'"); var primeInPassword= document. frmLogin. txtPassword.value.indexOf("'"); if (strUserID ==""){ alert("请您输入用户账号!"); return false; } if (strPassword ==""){ alert("请输入密码!"); return false; } if (primeInUserID !=-1){ alert("用户账号中不能包含撇号!"); return false; } if (primeInPassword !=-1){ alert("密码中不能包含撇号!"); return false; } } --> </script> 提交表单时运行“验证用户登录信息”的函数 <form method="post" name="frmLogin" action="verifyID.asp" onSubmit="javaScript: return validateLogin();"> |