I’m looking for a way to check two textboxes in a form to make sure at least one of them is populated. The validation should fail only if both textboxes are empty. Is there an easy way to do this using Unobtrusive JScript and MVC3 form validation?
Thanks
I’m looking for a way to check two textboxes in a form to make
Share
You could implement something like this answer by Darin Dimitrov.
It explains how to make your own custom validator (on both client and server side). It will use the MVC3 validation and JQuery unobtrusive validation. You could check if the condition is met (one or more checkboxes are checked) and validate based on that.