I have a problem that I have searched the internet for without success and I could now use help with. I am trying to get 2 combo boxes that lists the years from say ...1925 to 2014. The first combo box would be the FROM box range and the second box the TO box range, these values will later be used in a search query. How do I limit the years in the TO combo box to display greater than or equal to the FROM combo box value (year). It seems and looks stupid to list previous years in the TO box based on what is selected in the FROM. I am thinking this is a javascript thing based on the examples I have seen. So if some selects 1927 in the FROM field, the TO field would start at 1927 onward thru to 2014.

I am thinking this is a javascript thing based on the examples I have seen. So if some selects 1927 in the FROM field, the TO field would start at 1927 onward thru to 2014.

Here is a script that sets the beginning ot the "To" one greater than the selected "From" option. I have used node manipulation to do this job because I had problems with building a string using innerHTML in IE. It worked fine in all other browsers, but not IE. :rolleyes:

I have removed the values you used in the <option> tags. This script makes use of the text between the tags instead.

Here is a script that sets the beginning ot the "To" one greater than the selected "From" option. I have used node manipulation to do this job because I had problems with building a string using innerHTML in IE. It worked fine in all other browsers, but not IE. :rolleyes:

I have removed the values you used in the <option> tags. This script makes use of the text between the tags instead.

`

From 1925 1926 1927 1928 1929 1930 TO:

`

That is brilliant. FYI, I tested it on IE11, which I personally hate, and it works great. Now, next question, haha, sorry, but how to I access those variables in php? I mean, it displays great, but how do I get teh from number and to number so that I can apply my php/mysqli searches? Sorry, but I am in the learing process of javascript and find it hard to see the variables that I can apply.

AllanP
—
2014-03-10T04:07:11Z —
#4

But how do I get the from-number and the to-number so that I can apply my php/mysqli searches?

I am not a php programmer but after a little looking around I find that the best way appears to be to put your select and option elements inside a form and then submit the form to the server. This will cause the page to reload. You can read about the various options at the following link
stackoverflow.com