Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Regex According to Jeff

The right tool for the right job

Date Validation, part deux

I had this come up in a project I am working on for a customer, and just answered a message on http://groups.yahoo.com/group/dotnetregex/ about time validation (nope, sorry, answered it somewhere else, suggested they use above list).
 
“The easiest input to validate is input that can't be wrong”.
 
Seems like a pretty silly thing to say, self evident to say the least.
 
So why is it that people still use text boxes for dates and times?  Why not use a tool like http://www.excentricsworld.com/CustomControls/CalendarPopupDemo.aspx for dates?  Very cool, you can set it to display as a label, click a button, chose your date and update the label.
 
For time it's a little more intensive, there are 1440 minutes in a given day, so we really don't want to have a drop down list with 1440 items (plus one as a default).  A digital clock isn't that bad:
 
H: 1-12 (or 0-23)
MTens: 0-6
MOnes: 0-9
AM/PM (or nothing if 0-23)
 
Taking a lot of ambiguity out of a user interface leads to less things to validate on the back end.
 
Every once in a while the obvious needs to be stated, and I'll do it if no one else will :)
Sponsor
Published Thursday, December 04, 2003 3:06 PM by jeffrey
Filed under:

Comments

 

TrackBack said:

January 7, 2005 9:20 AM
 

TrackBack said:

January 10, 2005 8:47 AM
Anonymous comments are disabled