I have a dropdown, where if a certain item is selected a subform pops up (hidden div that appears) with more stuff that needs to be filled out. What is the best approach to validation for something like this? I thought about writing a validator (with ValidationAttribute, IClientValidatable) but this means i have to take that group of boxes out from the rest of the form so they can be validated as 1 object.
Thanks in advance.
Follow Up: I found this that does what I want client-side! http://foolproof.codeplex.com/
[RequiredIf]
[RequiredIfNot]
[RequiredIfTrue]
[RequiredIfFalse]
[RequiredIfEmpty]
[RequiredIfNotEmpty]
[RequiredIfRegExMatch]
[RequiredIfNotRegExMatch]
_
Nevermind already found a bunch of problems with foolproof
You will need to extend the ValidationAttribute to create a custom validator. It could be something like this: