victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
972 stars 476 forks source link

using any module and security disables the password strength meter #695

Open mikfire opened 6 years ago

mikfire commented 6 years ago

I am using jquery form validator 2.3.77 and jquery 1.10.2 and I am uncertain if this is supposed to work and doesn't, or if it simply isn't expected to work.

Given I have a password field defined like this:

<INPUT name="thisPassword" 
    data-validation="strength"
    data-validation-strength="2"
    class="form-control" 
    id="thisPassword" 
    type="password" 
    placeholder="Enter password" 
    value="">

and I invoke validate like this:

$.validate({
    modules: 'security', 
    onModulesLoaded: function() {
        $('input[name="thisPassword"]').displayPasswordStrength();
    }
});

I get the strength meter as I expect. If I change the invocation to look like this

$.validate({
   modules: 'security toggleDisabled', 
   onModulesLoaded: function() {
      $('input[name="thisPassword"]').displayPasswordStrength();
   }
});

I don't get the strength meter any more. I've tried a number of different invocations and it all ends up without a strength meter. I have also tried using sanitize instead of toggleDisabled. They all give the same results.

Is this expected behavior?