• Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying Multiple Select Box Selections  RSS feed

 
M. Cotton
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a jsp page with a multiple select box. The box is populated with an array from which the user can make multiple selections and have those selections populate a variable in a database and separate those selections with a comma. Everything works fine with the exception of, when the user wants to edit the selections in the list box they only see one selection (if only one selection is choosen) or no selections if multiple selections have been choosen. My goal is to have the box show the array with the selections highlighted. Can anyone tell me what I am missing? I am sending my code along for your reading pleasure. Thanks in advance for any and all help!

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First things first. Why on earth are you generating markup inside Java inside a JSP? The whole point of a JSP is to be a markup template.
 
M. Cotton
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,
This is code that I have inherited within a production app.
M.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My condolences. Any chance you can refactor it to be a bit less silly?
 
M. Cotton
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I plan on doing it eventually, I was just trying to make a quick fix for the time being.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The next debugging step that I would take is to inspect the formatting of the HTML that is being sent to the browser for the <select> element and its <options> to see why the selections aren't showing up. Chances are that it's an HTML formatting error.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!