"John" <a@b.com> wrote in message
news:O0**************@TK2MSFTNGP09.phx.gbl...
Hi all,
What is an elegant way of allowing a user to enter a date into a web form?
I'd like the date to be entered in dd/MM/yyyy format and validated on the
client as well.
Regards
John.
Use a regular expression validator with
"(0?[1-9]|[1-2][0-9]|30|31)/(1[0-2]|0?[1-9])/[0-9][0-9][0-9][0-9](.)*" as
the validation Expression (this however will accept 31/2/9999 as a valid
date. Feel free to tighten it up if you want). I believe it will be
validated clientside.
If you want to be really picky, write a custom validator in JScript (just
remember to do a stricter check on the server side as well as not all
browsers will run JScript).
--
Brian Barnes
No Spam Proof e-mail
Use News Groups