阅读背景:

html表单 提交时对用户名和密码进行验证

来源:互联网 

<script language="javascript">
function ValidateForm(theForm)
{
 if (theForm.UserName.value.length==0)
 {
  alert("please input the name!")
  theForm.UserName.focus();
  return(false);
  }
  
  
  
  if (theForm.password.value.length>=8)
{    my=document.getElementById('password').value
   var re =  /[a-zA-Z](?=.*?[1-9].*?)[a-zA-Z1-9]+|[1-9](?=.*?[a-zA-Z].*?)[a-zA-Z1-9]+/g; 
     if (!re.test(my))  
    {  alert("password type error!")
       return(false); 
    }
   }
    
 else{
  alert("password length error!")
  return(false);
  }
}
</script><script language="javascript">
function Vali



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: