I need to enable the validation of hidden fields using ASP.net MVC3 unobtrusive validation.
The reason behind this is a jquery plugin which hides the original input field to show something fancier. But this disables validation of the field as it becomes hidden.
I tried to use the following code but without success.
$("form").validate({
ignore: ""
});
Thanks
With a hint from this Question I was able to manipulate the options of the unobtrusive validator object.
var validator = $("#myFormId").data('validator');
validator.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