showing results for - "password strength checker javascript"
Felipe
10 Nov 2016
1<script language="javascript">
2    function passwordChanged() {
3        var strength = document.getElementById('strength');
4        var strongRegex = new RegExp("^(?=.{14,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
5        var mediumRegex = new RegExp("^(?=.{10,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
6        var enoughRegex = new RegExp("(?=.{8,}).*", "g");
7        var pwd = document.getElementById("password");
8        if (pwd.value.length == 0) {
9            strength.innerHTML = 'Type Password';
10        } else if (false == enoughRegex.test(pwd.value)) {
11            strength.innerHTML = 'More Characters';
12        } else if (strongRegex.test(pwd.value)) {
13            strength.innerHTML = '<span style="color:green">Strong!</span>';
14        } else if (mediumRegex.test(pwd.value)) {
15            strength.innerHTML = '<span style="color:orange">Medium!</span>';
16        } else {
17            strength.innerHTML = '<span style="color:red">Weak!</span>';
18        }
19    }
20</script>
21<input name="password" id="password" type="text" size="15" maxlength="100" onkeyup="return passwordChanged();" />
22<span id="strength">Type Password</span>
queries leading to this page
js test password strengthhow to check password length javascriptpassword strength checker javascript w3schoolspassword strength checker javascript regexmeasure password strength in javascriptjavascript for password strengthpassword strength checker javascriptpassword strength checker javascript codeshow password strength javascriptpassword strength javascriptpassword security check jsjavascript password strengthpassword strength meter javascript codestrong password check in javascriptcheck password strength using javascriptpassword strength meter jshow to check password length in javascriptpassword strength js javascript password strength checkerstrong password checker javascriptcheck password strength javascriptpassword strength jscheck the password reliability level in javascriptstrength password in javascriptstrength password checker jscheck strength code of password javascriptjavascript password strength validatorcheck password strength jspassword strength checker jsjavascript password strength checksimple password strength checker javascriptpassword strength javascript examplepassword strength meter in jscheck password strength in javascriptpassword strength checker jqueryjs check password strengthjavascript check password strengthjs password strength checkerjs password strength validationvalidate password strength javascriptdevelop password strength checker javascriptpassword strength validation in javascriptjavascript password strength validationcheck password length in javascriptjs password strengthhow to make a strong password checker in javascriptcheck strength of password javascripthow to make a password strength check in javascriptjavascript password strength metercode to check strength of password javascriptpassword strength meter javascript password checker javascriptenforce password strength using javascriptpassword strength check on jsjavascript password strengthcheckerpassword meter strength jspassword strength bar jsjs password strength formulajs password strength meterjavascript validation password strength checkerpassword strength checker javascript