I want to invalidate my password field if password strength is weak.
I am using "pstrength" method to calculate password strength.
Bar below password input box changes color as password strength increases.
I am using jQuery Validation plugin to validate rest of my form fields which is working fine.
I need to trigger error messages if password is weak , say if strength is less than 30 count(e.g. in fiddle) and strength bar color is yellow or green.
I have added fiddle for the same here
addMethod will add new validation method but actually i need to trigger error from external functionality "pStrength" when passwordStrength is lower than expected
I tried to call it as for e.g.
if(passwordStrength < 30){
var $validator = jQuery("#registerForm").validate();
$validator.showErrors("password strength is low");
}
But no luck