It's not a secret anymore!*
The moose likes Servlets and the fly likes I want to fill a Listbox with values dynamically using JSP when I press a button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "I want to fill a Listbox with values dynamically using JSP when I press a button " Watch "I want to fill a Listbox with values dynamically using JSP when I press a button " New topic
Author

I want to fill a Listbox with values dynamically using JSP when I press a button

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have one combo box , and two list box and a button.
select name="mgroup" size="1"
option AAA option
option BBB option
option CCC option
select
select name="sgroup" size= 5
option value= 1 1 option
option value= 2 2 option
option value= 3 3 option
select
select name = finalsk select
I have a ADd button and when I press I have to display the value I selected in the combo and in the list (first) in the second list box..
"finalsk".
I am able to fill the "finalsk" list box with values
but when I try to see the source of the HTMl file it still shows
select name = finalsk select.. It has to show,.. say suppose I chose AAA and 1
select name = finalsk
option value= AAA1 AAA1 option
select
I want to update my form element "finalsk" with the values the user has
selected.
how to Do???
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Assuming you want a servlet to calculate what the values in the third list box are, the only way I can think to do it without just regenerating the whole page is to put the third list box in a separate Frame and have your servlet regenerate the contents of that Frame.
An applet would also work of course.
Bill
 
Don't get me started about those stupid light bulbs.
 
subject: I want to fill a Listbox with values dynamically using JSP when I press a button
 
Similar Threads
combo box
Populate JCombo Box with different Values in each Row in JTable
Struts 1.1: Help needed with html:select, html:options, html:optionsCollection
Help needed with onChange()
retreving values from table and put it in Combo Box