I am running into a problem with jQuery Validation and need to ignore some fields.
I need to ignore fields based on a class that I set and then also all hidden fields. What I need to do is the following, but it is only honoring the second ignore. I am assuming there is a way to tell jQuery Validation these multiple selectors but I cannot seem to find it.
validator = $("#form1").validate({
onsubmit: false,
ignore: ".ignore",
ignore: ":hidden",
Thanks,
Tim
From the validation documentation:
jQuery's not-method is used, therefore everything that is accepted by not() can be passed as this option.
Therefore all you need to do is pass one parameter with your selectors separated by commas:
validator = $("#form1").validate({
onsubmit: false,
ignore: ".ignore, :hidden"
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With