HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 3rd, 2000, 12:03 AM
dave981 dave981 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Minneapolis, MN
Posts: 48 dave981 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 53 sec
Reputation Power: 9
Send a message via ICQ to dave981
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).]

Reply With Quote
  #2  
Old October 5th, 2000, 07:46 AM
tvanbart tvanbart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 35 tvanbart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Radio Button selection changes Menu pulldown


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT