• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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: 67756
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
reply
    Bookmark Topic Watch Topic
  • New Topic