I am performing date validation on several forms. This validation includes making sure a date does not fall on a weekend, does not fall on a major holiday, is at least 3 business days from the current date.
I currently display the error messages one at a time - if the date is on a weekend, I stop and return the message. If the date is not on a weekend, but is on a holiday, I stop and return the message. Etc., etc..
I visited a website the other day that validated several date scenarios at once, and returned the message.
I'm wondering what everyone thinks is the best way to display these errors - one at a time, or some combination.
One at a time:
- if the user selects a Saturday/Sunday:
- "Please select a date that does not fall on a weekend"
- if the user fixes it but selects a holiday, then:
- "Please select a date that does not fall on a holiday"
- if the user fixes it but selects tomorrow, then:
- "Please select a date that is at least 3 business days from now"
- if the user selects a Saturday/Sunday:
All at once:
if the user selects a weekend, a holiday, or tomorrow, then:
- "Please select a date that does not fall on a weekend"
- "Please select a date that does not fall on a holiday"
"Please select a date that is at least 3 business days from now"
- Some combination
if the user selects a Saturday/Sunday or a holiday:
- "Please select a date that does not fall on a weekend"
- "Please select a date that does not fall on a holiday"
- if the user fixes it but selects tomorrow, then:
- "Please select a date that is at least 3 business days from now"
FYI, simply not allowing certain values to be selected does not preclude the need for validation. Don't forget, someone could use something like TamperIE or Fiddler to manipulate the form post! Graying out dates does stop the problem client-side, but I still need server-side validation to handle the form values AFTER posting.