"Hai Nguyen" <ha******@neo.tamu.edu> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I want to validate a textbox with date in the right format. I already have
it worked. However, my validation expression does not solve the # of days
in Feb; for isntance it does not solve for leap year like on Feb there are
maybe 28 or 29 days
Thank for any help
I am guessing (as you didn't specify it) that you are using a
RegularExpressionValidator
and that you want a RE that correctly checks for leapdays.
That can't be done (or at least not without a very complicated RE).
You already have a RE that checks if the string "looks like it could be a
date".
You could add a CustomValidator with server-side code that checks if it is
a real date ("does DateTime.Parse accept it?") and even add a client-side
function that does the same.
Hans Kesting