parsley

Parsley validate dynamic input field


I'm trying to validate an input field which is 'disabled' when the page loads, but it will, somehow, become visible and editable.

I excluded [disabled] from parsley, but when I'm trying to refresh constraints on that field, nothing is working. I tried to call addValidation() when the field appears but no success.

Is there any method to do this? I can't destroy the form (that's not working either).


Solution

  • Found out how to do this.

    Just call _refreshFields() on your form.

    $('form').parsley()._refreshFields()