File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Auto Populate Combo Box upon Radio Selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Auto Populate Combo Box upon Radio Selection" Watch "Auto Populate Combo Box upon Radio Selection" New topic
Author

Auto Populate Combo Box upon Radio Selection

Nitin Sinha
Greenhorn

Joined: May 08, 2008
Posts: 17
I have four radio options and one combo box in my form.

Radio Option 1
Radio Option 10
Radio Option 20
Radio Option 30

What I want is that if i select Radio Option 1, then the combox box should get populated with values 1 through 9. Similarly if i select Radio Option 20, the combo box populates with values 10 through 19 and so on.

How can i achieve this in HTML using Javascript ? Please assist me with the code.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Remove options from a select


Add An Option


Read a value



Hopefully you can figure out how to use onchange and a for loop to make it work.

Eric
Nitin Sinha
Greenhorn

Joined: May 08, 2008
Posts: 17
This is kind of tough to understand this way.. Can you give me some link of working example to explain the same
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61601
    
  67

HTML has no Combo Box control; please use proper terminology. Please read this for more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Auto Populate Combo Box upon Radio Selection