One Validator to validate multiple controls?
Posted on 2004-03-26
Hi, I'm creating a registration page for a website. On it, the user needs to enter their birthdate. I have 3 textbox controls, one for month, one ofr day, and one for year for the user to input their birthdate. Right I have to create 3 seperate RequiredFieldValidator to make sure user put something in those 3 textboxes, then I have 3 different CustomValidator to validate that they have entered the correct dates. i.e. making sure no1 put 9999 or 1000 as their birth year or put 30 as their birth month. My question is, is there a way to just have one custom validator to do all that? Instead of checking one TextBox at a time, can I do something to check all 3 at the sametime and just output 1 error message instead of 3 seperate ones? thanks!