Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make multiple combo boxes with same data

 
Sachin Negi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a scenario in JSP where i have to make a combo with a list containing 10 items say 1,2,3.... 10. now i select a combo. I also need to provide an add button that will add another combo with same elements except the one being selected in previous combo.

eg- if 1st combo selected value is 1 then in the next combo i'll have the list as 2,3,4.....10 i.e, having 9 elements and so on. the user can add 10 combos like this, each combo having the items that haven't been previously selected.

can anyone help me with this???
thanks in advance !!!
 
Ackshat Sharma
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use a simple javascript code on any event you like to have(e.g click focus or blur etc) , the logic may vary as per your need. i would not prefer to do it with a java code in jsp since on browser i need a dynamic response without playing with request and response.

for information regarding javascript refer javascript examples
 
Keith Wood
Author
Ranch Hand
Posts: 38
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using jQuery you would do something like this:



However, you'll need to think about what happens when the user goes back to one of the earlier select boxes and changes the value.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic