JavaScript Tutorial User Registration Password Strength Validator
<!doctype HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/ Tr/xhtml1/dtd/xhtml1-transitional.dtd ""
<html xmlns= "http://www.jzread.com/1999/xhtml"
<head
<meta http-equiv= "Content-type" content= "HTML; charset=gb2312"/>
<script language= "JavaScript Tutorial" >
Password
var Tmp=document.regform.u_password.value;
if (Tmp.length < 6) {
Alert ("Hint: nn password length must be greater than 6");
Document.regform.u_password.focus ();
return false;
}
if (Tmp.length <6) {//&&/^d+$/.test (TMP)
Alert ("Hint: n password is too simple, please set a combination of letters, numbers, or symbols.") ");
Document.regform.u_password.focus ();
return false;
}
if (Document.regform.u_password2.value!= document.regform.u_password.value) {
Alert ("Hint: nn two times password inconsistency");
Document.regform.u_password2.focus ();
return false;
}
</script>
</head>
<body>
<form id= "Form1" Name= RegForm "method=" POST "action=" "
<label>
Enter password:
<input type= "Password" name= "U_password"/>
Confirm password:
<input type= "password" name= "U_" Password2 "/>
</label>
<label>
<input type=" Submit "name=" Submit " Value= "Verify" onclick= "Checkpass ();" />
</label>
</form>
</body>
</html>