By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Checking date past from 3 <SELECT> fields

P: n/a
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?

Rgds

Robbie

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/...e.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.

Jul 20 '05 #2

P: n/a
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.

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.