473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Checking date past from 3 <SELECT> fields

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
2 1838
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrea | last post by:
Hi, I'm trying to emulate part of our client-server application as a web site so customers can use it, and I'm stuck when it comes to re-ordering items in a list. Basically we have a list of...
1
by: Ang Talunin | last post by:
Hey, I wondering if it's possible to retrieve all the <option>-fields from a <select> when posting a <form> to a php file Example: I've got a form like this: <form action = phpfile.php...
2
by: Laphan | last post by:
Hi All Could you please confirm what the syntax is to change the style of a <SELECT> box using CSS. I basically want to take the 3D effect off this box, but it doesn't seem to be possible...
6
by: Bonge Boo! | last post by:
This has got to be obvious, but I can't make it work. I have a form called with 3 pull down menus. They are linked to a database which generates the values for the <SELECT? Pull-downs. Lets...
3
by: Astra | last post by:
Hi All Wondered if you could help me with the below query. I have 1 simple table called STOCKCATS that consists of 2 fields. These fields are called CATID and LEVEL. The contents of this...
0
by: rayone | last post by:
Hi folks. I need advice. 2 options, which do you think is the better option to display/retrieve/report on the data. Keep in mind reporting (Crystal), SQL Performance, VB Code, usability,...
4
by: VK | last post by:
I'm looking for autoexpand <select> list onfocus and collapse it back onselect/onblur (the list is select-one type) I know it is not possible directly, but I've seen here a hack by changing...
1
by: ghadley_00 | last post by:
Hi, I have a php form that encodes the responses to various <Select> field drop down menus as numbers (e.g. 0 to 50), and then posts the data to a MySQL table. I am trying to implement a form...
5
by: Alan M Dunsmuir | last post by:
I have a Form with a <SELECTtab, its <OPTIONtabs generated by records in a database table using PHP5 and a 'SELECT' query. The values displayed are chosen to be recognisable to the users (they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.