Thanks George
George Jempty <fl********@bellsouth.net> wrote in message
news:B7******************@bignews1.bellsouth.net.. .
Astra wrote:
Hi Guys
Can anybody advise me on how to check for a 'no later than today's date'
value from 3 <SELECT> fields.
I have 3 <SELECT> fields, which are one for the day, one for the month and
one for the year. All are numeric, ie the day format is 1 not 01, the
month format is 11 not Nov, the year format is 2004.
I have done a bit of ASP to make these <SELECT> fields auto-SELECTED to
today's date.
What I want to check via a client-side script to make sure that when they
click the Submit button, the date that they select is at least no later
than today's date before the submit process can continue.
Any ideas?
Create two date objects. One with no arguments will represent today.
The other one you will pass the appropriate arguments from the dropdown.
From the documentation at:
http://devedge.netscape.com/library/...5/reference/da
te.html#1193137
The format for calling date in this way is as follows:
new Date(yr_num, mo_num, day_num
[, hr_num, min_num, sec_num, ms_num])
So it looks like the first 3 arguments are the relevant ones for you,
and the others are optional anyway.
These Date() objects will return the number of milliseconds since time
began sometime back in 1970 ;) Just do a boolean greater than/less than
type comparison on them.