Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

add or remove an item from drop down

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have two combo boxes,
combo box1 has numbers (one,two,three,four).
and combo box2 has (red,green,yellow).
now if i select "one" from combo box1, then only "red" and "yellow" should appear in combo box2,
but if i select "two" or "three" or "four".. all the three "red","green","yellow" should appear in combo box2..

the bottom line is i need to add and remove item from a combo box dynamically using java script function in a jsp.

can someone help me on this,
i googled a lot but couldn find a solution.
[ October 22, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, a terminology correction. They are not "combo boxes". They are dropdowns or select elements. A combo box is a type of control avaulable in desktop applications that is not available on the web.

Get yourself a good JavaScript DOM reference and look up the API for the select element. There are methods to do what you are asking.
 
dinesh rackson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry..
i meant drop down list box only...
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.mredkj.com/tutorials/tutorial005.html

Eric
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic