< Buzzing or vibrating the login form using jquery Posted On May 15, 2012 : 0 comments << >> Simple div slideshow using jquery Posted On May 9, 2012 : 0 comments << >> Copy mysql column in varchar to type date Posted On May 3, 2012 : 0 comments << >> Enter only numbers inside a input field of a form using javascript Posted On May 1, 2012 : 0 comments << >> Slide in and out animate div vertically using jquery Posted On April 25, 2012 : 1 comment << >> Tag cloud using php, mysql and ajax with filter Posted On April 24, 2012 : 0 comments << >> Change webpage font color or background color from the user side using javascript Posted On April 19, 2012 : 0 comments << >> A single link that cycles through several webpage background color using javascript Posted On April 17, 2012 : 0 comments << >> Simple webpage redirection using perl script Posted On April 10, 2012 : 0 comments << >> Get ipaddress using perl script Posted On April 4, 2012 : 0 comments << >>

Check password strength using javascript

This Tutorial Has Been Viewed 3,989 Times.
VN:F [1.9.17_1161]
Rating: 5.7/10 (9 votes cast)

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.

Please make sure that when you just copy and paste the code given below do remember to change the quotes, it will be in ascii character while copying.Dont forget!!!!, if it is not changed the script wont work.

For example as you can see the quotes in the first line where the javascript is inside ” quotes and this one must be changed to double quotes when it is coped to your code.

<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.

VN:F [1.9.17_1161]
Rating: 5.7/10 (9 votes cast)

Check password strength using javascript, 5.7 out of 10 based on 9 ratings

Incoming search terms:





You will also be interested in ,

Tags:

Leave a Reply

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks