I am using jQuery Unobtrusive validation to validate fields on my forms.
I want fields in the form to be conditionally visible. For example, if the user selects a checkbox, several fields will appear.
I got all of this working, but if a user submits a form that includes hidden fields that are marked with the RequiredAttribute, then the form will not validate successfully because it thinks that the hidden fields are blank (note: I am talking about validation on the server-side - client-side validation is working as expected).
How can I exclude hidden fields from the server-side validation process?
p.s. I have already looked on Google and I did not find any elegant solutions for this - I feel like this should be something easy to do.