hidding dropdown menu

U

ulyx

I have 2 dropdowns.
How to hide ( on selection ) second dropdown if the selected value in first
dropdown, is greater then the value in second dropdown ?
 
B

Bart Van der Donck

ulyx said:
I have 2 dropdowns.
How to hide ( on selection ) second dropdown if the selected value in first
dropdown, is greater then the value in second dropdown ?

<form>
<select name="s1" onChange="
var F = document.forms[0].s2
this.options[this.selectedIndex].value>F.options[F.selectedIndex].value?
F.style.visibility='hidden':F.style.visibility='visible'
">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<select name="s2">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
</form>

Hope this helps,
 
M

mick white

ulyx said:
I have 2 dropdowns.
How to hide ( on selection ) second dropdown if the selected value in first
dropdown, is greater then the value in second dropdown ?
onchange='
if(selection one reference > selection two reference){
document.forms["form name here].elements["select list 2 name
here"].style.display="none"
}'
Mick
 
J

Joja

How to expand this script for use with 4 dropdowns ?


mick white said:
ulyx said:
I have 2 dropdowns.
How to hide ( on selection ) second dropdown if the selected value in first
dropdown, is greater then the value in second dropdown ?
onchange='
if(selection one reference > selection two reference){
document.forms["form name here].elements["select list 2 name
here"].style.display="none"
}'
Mick
 
J

Joja

Well, yes and no :)). Basicly i want to make the same thing like the poster
before, but with 4 dropdowns, and only one can be "the main one". I meen, if
you select the main one, then all others should hide.

***************************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top