I have a form as part of an e-commerce verification process that has a section for a billing address that allows the user to use their delivery address or fill in the address on the form. If the user chooses to use his delivery address, I do not show the address field.
I added validation for all fields, and then on the server side. I check which option was selected and remove all validation errors for the fields that are now hidden. This works fine on the server site, but I would like to use MVC 2 client side validation and you need a way to do the same on the client side.
I would like the javascript validation to ignore any hidden fields. Is there a good way to do this or is it a case of hacking the MicrosoftMvcJQueryValidation.js file?
source share