正在加载中...
信息详页
返回JS校验密码复杂度必须包含字母、数字、特殊符号
<html> <head> <meta charset="utf-8"> <title>密码验证</title> </head> <body> </br> <form action="Admin_Cklogin.asp" method="post" name="form" onsubmit="return test()"> <input type="Password" id="LoginPassword"> <button type="submit" id="re"> </form> <script> function test(){ var text= document.getElementById("LoginPassword").value; var re =/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,30}$/; var result= re.test(text); if(result) { /*alert("输入正确");*/ }else { alert("密码中必须包含字母大小写、数字、特称字符,至少8个字符"); document.form.LoginPassword.focus(); return false } return true; } </script> </body> </html>