Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Dropdowns

Status
Not open for further replies.

DaveyRichards

Programmer
Nov 8, 2006
14
GB
Hey guys.

I am having a problem with my drop down menus. What I am trying to do is have two separate drop down menus and when a specific option in the first one is selected, the second one will become visible.

At the moment I have the following on the "onchange" event for my first dropdown:

onchange="if(this.selectedIndex='someoption'){this.form['dropdown2'].style.visibility='visible'};"

With this code in place the "dropdown2" is appearing no matter which option I select and "dropdown1" is getting stuck at its first option.

Thanks
 
>this.selectedIndex='someoption'
[tt]this.selectedIndex=[red]=[/red]'someoption'[/tt]
Also since you compare selectedIndex, I suppose by 'someoption' you meant some _number_, not something else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top