I have a simple validate block like this:
$("#myForm").validate({
ignore: ":hidden"
});
When the user clicks a certain button, I would like to change that ignore rule to ignore: []
, then validate it and then switch back. I realize I could use classes instead but I want to know if there is a way around that.
Edit:
It should be noted that ignore: []
is the proper way to do it when using .validate()
.
$('#myForm').validate().settings.ignore = "newIgnore";
The validate() method returns you a reference to the validator object you created with your original validate() call.
You can then call the property .settings.ignore
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