aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes trying to insert values into select using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "trying to insert values into select using javascript" Watch "trying to insert values into select using javascript" New topic
Author

trying to insert values into select using javascript

puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
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

Joined: Jan 10, 2002
Posts: 60046
    
  65

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
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

Joined: Jan 10, 2002
Posts: 60046
    
  65

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

Joined: Nov 06, 2012
Posts: 32
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
Show us what is generated, looking at that serverside markup is useless when trying to debug JavaScript.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to insert values into select using javascript
 
Similar Threads
option values are not being shown when using javascript
Two actions in a single JSP
How to get ajax response in jsp page
Need Help With Dynamic text box in JSP
document.getElementById() not working