I have a web control that takes a date input. There are two types of
validation I want to do on this:
1) validate that the date input is in the proper format, and display a
message if otherwise
2) validate that the date is not prior to today, and display a message if
otherwise.
For these validations, I use CompareValidator to ensure the date is not
prior to today, and RegularExpressValidator to ensure the date is in the
proper format (mm/dd/yyyy).
However, it appears that both of these validators fire and display. So, if
the user enteres in a bogus date (ABCDEFG), they get both the error message
that the date is in the improper format AND that the date is prior to today.
If the date isn't formatted corretly, I don't want the "prior to today"
validation to fire. But I can't seem to do that, and my page always displays
both error messages.
Is there any way to do this?