Reputation: 15593
Assuming I have a specific problem which I need to remove some dataannotations's required attributes, how can I do this?
I know about view-model but I don't want to use it for some reasons.
Upvotes: 2
Views: 4888
Reputation: 5313
this will disable the validations on certain elements based on a selector
var validationSettings = $.data($('#formToValidateId').get(0), 'validator').settings;
validationSettings.ignore = '.ignore';
check this blog for more info
Upvotes: 1