I\'m using ASP .NET MVC 3 with Data Annotations and the jQuery validate plugin.
Is there a way to mark that a certain field (or certain data annotation) should only
I ran into trouble with data_val="true". I had a sequence of radio buttons tied to a single property in my model. The data validation only worked when I applied data_val="true" to the first @Html.RadioButtonFor call.
In debugging this, I discovered you can also disable or alter individual rules on the client side by using data_rule_??. The rules can be found in the jquery validation documentation.
for example;
@Html.RadioButtonFor(m => m.Answer, "Yes", new { data_rule_Required = "false" });
@Html.TextBoxFor(m => m.Answer, new { data_rule_minlength = "10" }