Click to See Complete Forum and Search --> : date validation


tvfoto
05-16-2007, 10:45 AM
Hello,

I have to and form inputboxes for a range of date to be searched and I am using Datetime format in my SQL server table. Quetions:

a) ValidationExpression="\d{2}/\d{2}-/d{4}". This is just for any 2 digits/2 digits/ 4 digits format. How do I change this to be mm/dd/yyyy? where mm will stop at 12 and dd will stop at 31 or 28 or 29 (depending on month/year)

b) How do I ALSO validate if one of the text box is null ? Can I have more than one validator referring to the same text box or the same validator referring to both text box? How does this work?

c) since i am using the Datetime format, do I really need to do (a)? Is there just a simple date validation function that I can use?

Thanks

lmf232s
05-16-2007, 03:32 PM
you can give this a shot. Not sure if this will fit your needs or not.

http://www.w3schools.com/aspnet/showasp.asp?filename=demo_rangevalidator

to make it mm/dd/yyyy you just need to set the dates for the min and max as such.