I am generating a list of elements on a page, and they all have validators attached to them. When I look in the HTML source, I see something like:
<input type="text" id="email" name="email" data-val-required="No valid email address!" data-val="true">
I need a way to dynamically enable/disable the validation for such an element. I tried to enable/disable the data-val
attribute by setting it to false
and then back to true
. But it doesn't seem to response to that; the validation is always there!
Does anyone have any idea how I can enable/disable validators on certain fields dynamically?
settings.ignore = ":hidden, .ignore"
Personally I prefer to add:disabled
also – Ious