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!

Using javascript with HTML dropdown lists

Status
Not open for further replies.

johnsimpson

Programmer
Mar 28, 2006
60
GB
Hi quick question,

I have got a drop down list built in HTML and i want to add a feature to it so that basically if the client was to choose the option USA a secondary drop down box would appear which would contain a second set of options to select from.

how can i do this?

thanks in advance

J

 
This same issue has been covered several times in the last week, just read through a few of the recent posts.

There are also several examples in the FAQs section in this forum.


It's hard to think outside the box when I'm trapped in a cubicle.
 
yes i see what you are saying but i dont think what i need to do needs to be that complicated. basically if the user selects the USA option from a dropdown i want another dropdown to appear. The values of the second drop down doesnt change and will only appear when USA is selected.

Basically the first drop down box contains the following:

UK
Europe
USA
Rest of world

when UK, Europe or Rest of world are selected it goes to the relevant pages. But the USA has lots of different states as well so i want to display another dropdown next to the first (but only when USA is selected)

does that make sense?

J
 
Then create the second option list with the states and set it's visibility to hidden with style="visibility:hidden"

Set an onchange event for the first box so when a change occurs it tests if the current selection is USA and if so alter the visibility of the second box to visible.


It's hard to think outside the box when I'm trapped in a cubicle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top