|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can someone point me in the right direction for this one (I am at a total loss since i've never seen this done before).
What i would like to do is have an radio-button option so that a user can choose between 3 different options. And based on what they choose, it affects what options will appear on the pulldown menu: ( ) North ( ) South ( ) East [State Pull down menu] [___City____] [go] then they can type in their own city, and click go. (basically, the Pulldown menu and the City varible would be the only parts that go to the CGI - i just want to keep the pull down menu as short as possible for my users. thanks for any help! Dave [This message has been edited by dave981 (edited October 02, 2000).] |
|
#2
|
|||
|
|||
|
Look in the Javascript reference at http://developer.netscape.com . From this it appears that you can create/delete SELECT options on the fly, so you could write 3 functions (north, south, east) that each clear out all the SELECT options, and then populate the optionlist with the desired options. These functions could then be called from onClick event handlers in the options.
Code examples from the site (sorry, short on time, so I'm using cut&paste here): The following function removes an option from a Select object. function deleteAnItem(theList,itemNo) { theList.options[itemNo]=null history.go(0) } function populate(inForm) { colorArray = new Array("Red", "Blue", "Yellow", "Green") var option0 = new Option("Red", "color_red") var option1 = new Option("Blue", "color_blue") var option2 = new Option("Yellow", "color_yellow") var option3 = new Option("Green", "color_green") for (var i=0; i < 4; i++) { eval("inForm.selectTest.options[i]=option" + i) if (i==0) { inForm.selectTest.options[i].selected=true } } history.go(0) } success, Ton (Please post again if not clear) |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Radio Button selection changes Menu pulldown |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|