Forums

This topic is locked

Date Validation - How do you do it?

Posted 09 Jan 2002 13:26:30
1
has voted
09 Jan 2002 13:26:30 Aaron Jay posted:
I am trying to get a drop-down date (day month and year separately) when submitted to be compared to today's date. If the date submitted is before today's date, I have an error script I will run, but for some reason I can't get this comparison right. Anyone?

Replies

Replied 09 Jan 2002 13:36:03
09 Jan 2002 13:36:03 Mark Labordus replied:
I wonder what the error looks like, and the code you use to validate..

Replied 09 Jan 2002 14:54:08
09 Jan 2002 14:54:08 Kent Steelman replied:
In your list menu, you can assign values to the list that will be passed/submitted. Do you have these values in the same format at the date that they are being compaired to.

Wm. Kent Steelman
Replied 09 Jan 2002 15:42:37
09 Jan 2002 15:42:37 Owen Eastwick replied:
Something Like:

<%
varLocale = SetLocale(2057) 'Set the date format to UK - DD/MM/YYYY
varDate = Request("selDay" & "/" & Request("selMonth" & "/" & Request("selYear"
varDate = CDate(varDate)
If varDate < Date() Then
- whatever you want to happen if earlier than today
Else
- whatever you want to happen if today or later
End If
%>

If you want to make the time format US then use SetLocale(1033) see here for all the possible formats:

www.tdsf.co.uk/tdsfdemo/LocaleIDs.asp

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Reply to this topic