473,671 Members | 2,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1851
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********@bel lsouth.net> wrote in message
news:B7******** **********@bign ews1.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
3818
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 available articles ("availableItems") and a list of articles already in an issue ("selectedItems"). What I want is to be able to move articles freely between the two lists and then on submission add them to the issue (which I can), but also move...
1
2393
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 method=post > <select name= "name">
2
17499
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 like it is with an <INPUT> box. Thanks
6
2398
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 say I have values selected for all three pull down menus. When I change the first "top-level" menu I want to reset both the second and third menus to the "default" state.
3
1787
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 table are as follows:
0
2222
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, architecture. Case 1: On a web page I would like to render a dropdown list
4
2359
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 dynamically position static/absolute and sel.size - cannot google it out though. Also some GNU/copyleft widget would be equally great.
1
8829
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 to allow editing of the data already in the table. I can read the data out of the database without trouble, however I am having trouble figuring out a way to have the appropriate option in the <Select> fields chosen to reflect the data already in...
5
1714
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 are in fact a list of names), but the data I need to process in the post-back come from other related fields in the same database record. I'm clearly missing something very basic here. How do I access these fields after the selection has been...
0
8476
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7437
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4407
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.