Download
User Rating: 0/5 ( 0 votes)
passwordstrength.js is a minimal jQuery plugin that displays a password checker in a hint box to indicate the strength of your password.
Source: github.com
1. INCLUDE JS AND CSS FILES
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="jquery.passwordstrength.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.passwordstrength.css">
2. HTML
<input type="password" id="pwd" />
3. JAVASCRIPT
$(function(){
$('input#pwd').passwordstrength({
'minlength': 6,
'number' : true,
'capital' : true,
'special' : true,
'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'
}
});
});
4. OPTIONS
Option |
Type |
Default |
Description |
minlength |
Int |
8 |
Minimum length of password |
number |
Boolean |
true |
Password requires at least one number |
capital |
Boolean |
true |
Password requires at least one uppercase letter |
special |
Boolean |
true |
Password requires at least one special character |
You can change the labels with the labels option :
-
general : main label
-
minlength : for the minimum length label's
-
number : for the number label's
-
capital : for the one uppercase letter label's
-
special : for the one special character label's