Check password strength using javascript
Check password strength using javascript
Check password strength using javascript
Here is simple method to check the password strength using javascript, just copy and paste the script given below in your registration field and customize it accordingly.Add this code below inside the body tags of your page.
Some bugs have been fixed and the script is working fine now.
<script language="javascript"> function passwordCheck() {var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z]) (?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); var enoughRegex = new RegExp("(?=.{6,}).*", "g"); var pwd = document.getElementById("password"); if (pwd.value.length==0) { document.getElementById('check').innerHTML = 'Type Password'; } else if (false == enoughRegex.test(pwd.value)) { document.getElementById('check').innerHTML = 'More Characters'; } else if (strongRegex.test(pwd.value)) { document.getElementById('check').innerHTML = '<b><span style="color:green">Strong!</span>'; } else if (mediumRegex.test(pwd.value)) { document.getElementById('check').innerHTML = '</b><b><span style="color:orange">Medium!</span>'; } else { document.getElementById('check').innerHTML = '</b><b><span style="color:red">Weak!</span>'; }} </b></script> <input name="password" id="password" type="text" size="15" maxlength="20" onkeyup="return passwordCheck();" /> <span id="check">Type Password</span>
Thank you very much.
Check password strength using javascript,Incoming search terms:
- check password strength javascript (19)
- how to check password strength in javascript (18)
- javascript password strength script (13)
- password strength meter code in jsp (1)
- jsp code for password strong (1)
- password strength bar javascript (1)
- Password Strength Checker PHP ajax (1)
- password strength with javascript tutorial (1)
- password strength checker using java script (1)
- password strength checking java servlet (1)
- password strength code in php (1)
- jsp check password javascript (1)
- javascript RegExp password strength (1)
- check password using java (1)
- checking password strength using javascript (1)
- code to show password strength in jsp page (1)
- detect java script check for password characters (1)
- how can I check strength of password by javascript and change the colour (1)
- how to check password strenth in php (1)
- how to check the strength of password using jsp (1)
- How to write code for password strength and weak using jsp (1)
- [email protected] cn loc:US (1)