Skip to content

Instantly share code, notes, and snippets.

@arjunkori
Created November 13, 2018 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjunkori/b607f3f1eb177b19f6a7cecbdfaa790e to your computer and use it in GitHub Desktop.
Save arjunkori/b607f3f1eb177b19f6a7cecbdfaa790e to your computer and use it in GitHub Desktop.
1.bootstrap password strengh validator
$('#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