[thelist] Fomated tet box question

Chris.Marsh at Callserve.com Chris.Marsh at Callserve.com
Wed Mar 9 06:58:47 CST 2005


> My users enter a data in a simple text box.
> I would like the box to just except the date and not have to type the 
> slashes '\' for 03\09\2005
> example:
> ______________
>     \      \
> ______________
> I have read a little about masked text boxes,but there had to be a 
> easier way.

I have had success using select boxes instead of text fields. I use
javascript to dynamically change the number of days available as the
selected values in the month and year select boxes are changed. If the user
does not have javascript available, 31 days are available for each month.
Validation is performed on the server, as should always be done with any
form input. The order that the month and day select boxes are displayed can
be changed depending on the information ganied regarding the user's
geographical location. This, in addition to explicit labelling, reduces any
confusion regarding date formats between US and UK formats. It also requires
no extra logic when the date is processed on the server. The default value
can be today's (or any, for that matter) date. Is there any particular
rerason that yuo want to allow the user to input free text for a date?


Chris Marsh

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender and delete the email immediately. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. 

Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.

Finally, the recipient should check this email and any attachments for the presence of viruses. Callserve Communications accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan

More information about the thelist mailing list