Tiny jQuery Password Strength Checker - passwordstrength.js

File Size: 5.09 KB
Views Total: 3530
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Tiny jQuery Password Strength Checker - passwordstrength.js

A minimal jQuery plugin that displays a password checker in a hint box to indicate the strength of your password.

How to use it:

1. Include jQuery javascript library and the jQuery passwordstrength plugin's Javascript and CSS in the document.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.passwordstrength.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.passwordstrength.css">

2. Create a password input where you want to append a password strength checker while you're typing.

<input type="password" id="check">

3. Call the plugin on the password input and set the rules for the password strength checker.

<script>
$(function(){

$('input#demo').passwordstrength({
'minlength': 6, // Minimum length of password
'number'   : true, // Password requires at least one number
'capital'  : true, // Password requires at least one uppercase letter
'special'  : true, // Password requires at least one special character
'labels'   : {
'general'   : 'The password must have :',
'minlength' : 'At leaset {{minlength}} characters',
'number': 'At least one number',
'capital'   : 'At least one uppercase letter',
'special'   : 'At least one special character'
}
});

});
</script>

This awesome jQuery plugin is developed by shevabam. For more Advanced Usages, please check the demo page or visit the official website.