Methods for making sure date is entered in correct format
Posted: Thu Aug 05, 2004 6:02 am
A problem i always have is making sure people enter dates into forms int he correct format.
Say i wanted all dates to be ntered like 05-08-2004 i have a number of options
Option 1
Let the user enter anything they want, then use REGEX to check it. If it is wrong, spit out an error.
Good thing about this is that it is less time consuming for the user to fill in the dates as there are going to be quite a few date fields on the forms i am using
Option 2
Use select boxes in the form, so the user can only select options that are correct, not allowing them to enter incorect data. Making the user select the day number, the month number and the year from a drop down can be time consuming and laborious when there are a few date fields to be completed.
What other options could there be? What method would you go for?
Mark
Say i wanted all dates to be ntered like 05-08-2004 i have a number of options
Option 1
Let the user enter anything they want, then use REGEX to check it. If it is wrong, spit out an error.
Good thing about this is that it is less time consuming for the user to fill in the dates as there are going to be quite a few date fields on the forms i am using
Option 2
Use select boxes in the form, so the user can only select options that are correct, not allowing them to enter incorect data. Making the user select the day number, the month number and the year from a drop down can be time consuming and laborious when there are a few date fields to be completed.
What other options could there be? What method would you go for?
Mark