[Plain]
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> passwordCheck </title>
<Script type = "text/javascript" src = "Js/jquery1.6.1.js"> </script>
<Script type = "text/javascript">
$ (Function (){
$ ('# Pwd'). keyup (function (){
Var val = $ (this). val ();
IsDigit (val );
});
Function isDigit (s ){
Var pattern_d =/^ \ d + $/; // All numbers
Var pattern_s =/^ [A-Za-z] + $ // All characters
Var pattern_w =/^ \ w + $/; // number or character
Var pattern_W =/^ \ W + $ // all non-numbers and non-characters
Var pattern_r =/^ \ w + \ W + [\ w \ W] * \ w + $ // string that begins with a letter or number
Var html = '';
Var x = 0;
Var y = 0;
Certificate ('your user'{.html (s );
If(pattern_W.exe c (s )){
Html + = 'non-numeric or non-character <br/> ';
X = 0;
Y = 0;
}
If(pattern_w.exe c (s )){
Html + = 'Number or character <br/> ';
Y = 1;
}
If(pattern_d.exe c (s )){
Html + = 'all numbers <br/> ';
X = 1;
Y = 0;
}
If(pattern_s.exe c (s )){
Html + = 'all characters <br/> ';
X = 2;
Y = 0;
}
If(pattern_r.exe c (s )){
Html + = 'string starting with a letter or number <br/> ';
X = 3;
Y = 2;
}
If (y = 0 & x = 0 ){
Html + = 'incorrect password format <br/> ';
}
If (x> 0 & y = 0 ){
Html + = 'low security level <br/> ';
}
If (x = 0 & y = 1 ){
Html + = 'security level Medium <br/> ';
}
If (y = 2 ){
Html + = 'high security level <br/> ';
}
Html + = x + '<br/>' + y;
Certificate ('{password'{.html (html );
};
});
</Script>
</Head>
<Body>
<Form action = "#" method = "#">
Username: <input type = "text" name = ""/> <span id = "user"> </span> <br/>
Password: <input type = "password" name = "" id = "pwd"/> <span id = "password"> </span> <br/>
</Form>
</Body>
</Html>
Leave a message to share your thoughts.
When the password is a pure number or a pure letter, the security level is the lowest.
When the password is a combination of numbers and letters, the security level is medium.
The security level is high when the password contains numbers and letters and special characters.
When the password is a special symbol, spaces are not excluded.
When a special symbol exists, the special symbol cannot start or end with it.