-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate destroy is not working for me #52
Comments
Hi @binu101! You can send me a snippet of your code and jQuery version? |
Same for me, issue is on line 307 it should be |
Very thanks @benperiton! I'm working to fix this error. In the meantime, you can do anything like this to "destroy" validation: var
form = $('form').removeData('validate').off('validate');
$('input,select,textarea').filter(function() {
return form.is($(this).prop('form'));
}).off('validate'); To maintain current way: $.fn.validateDestroy = function() {
$(this).each(function() {
var
form = $(this).removeData('validate').off('validate');
$('input,select,textarea').filter(function() {
return form.is($(this).prop('form'));
}).off('validate');
});
}; |
Sorry, I would have sent a pull request but been far too busy today! |
Rest assured, your comment was very useful. Very thanks! |
I am unable to get this quick fix to work and am having the same issue it appears. I have a field hidden by default that only shows up if an option from a select is selected. When it shows up, I require that field, but if I then select something else in that first drop down it is still required even after removing data-required etc. Everytime I change the value of that first select I am attempting to destroy validation and then I revalidate after. Any ideas? |
I met with the same bug and fixed it in a similar way. So I just post it here for those looking to fix it themselves. In addition to line 307, u have to rename
Or just do a search and replace :-) Note : This is the same bug with #62 |
Hi,
I've made a dynamic validator for the web application which I'm currently working on.
I dynamically build the element selector and call the form validation like this:
However, when I want to reload the validation of a form, for example when loading different values from AJAX, i'm using a direct call to the form to destroy validation like:
This does not destroy validation, can you please help me?
The text was updated successfully, but these errors were encountered: