Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to insert values into select using javascript

 
puja shaw
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to insert multiple values into a select item in html.Please Help me.The following code is inserting only one item.I am not understanding where the code has gone wrong.




 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Showing us the server-side code is not helpful (And why are you creating HTMl from a servlet in the first place? That's a really poor practice.)

Please post the HTMl that is sent to the browser. You can find it using View Source in the browser.
 
puja shaw
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Showing us the server-side code is not helpful (And why are you creating HTMl from a servlet in the first place? That's a really poor practice.)

Please post the HTMl that is sent to the browser. You can find it using View Source in the browser.


the only new code here is out.println() and a for loop.The rest is all html.I need to write in a servlet as its my requirement.And thanks to the code tags that my html content is shown clearly away from the other part.So what is the problem.?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to UseCodeTags, and to make sure that the code is properly formatted and indented when you post it.
 
puja shaw
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Please be sure to UseCodeTags, and to make sure that the code is properly formatted and indented when you post it.


yes i used the code tags
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us what is generated, looking at that serverside markup is useless when trying to debug JavaScript.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I already asked for that, but this member seems to be reluctant to respond to requests for additional information that's needed in order to answer his questions. Not sure why.

puja shaw, if you want people to volunteer their time to help you, you are going to have to ShowSomeEffort and respond when people who want to help you ask for more information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic