Created
November 13, 2018 13:16
-
-
Save arjunkori/b607f3f1eb177b19f6a7cecbdfaa790e to your computer and use it in GitHub Desktop.
1.bootstrap password strengh validator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#change-password').bootstrapValidator({ | |
feedbackIcons: { | |
valid: 'glyphicon glyphicon-ok', | |
invalid: 'glyphicon glyphicon-remove', | |
validating: 'glyphicon glyphicon-refresh' | |
}, | |
fields: { | |
'new-password': { | |
validators: { | |
identical: { | |
field: 'confirm-password', | |
message: 'The password and its confirm are not the same' | |
}, | |
regexp: { | |
regexp: /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&*()]).{8,}/, | |
message: 'The password must have atleast 8 chars with uppercase,lower case,digit and one of the special characters' | |
} | |
} | |
}, | |
'confirm-password': { | |
validators: { | |
identical: { | |
field: 'new-password', | |
message: 'The password and its confirm are not the same' | |
}, | |
regexp: { | |
regexp: /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&*()]).{8,}/, | |
message: 'The password must have atleast 8 chars with uppercase,lower case,digit and one of the special characters' | |
} | |
} | |
} | |
} | |
}).on('success.form.bv', function(e){ | |
//OPERATION AFTER SUCCESS | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment