This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes putting values from ArrayList to optionlist/dropdownlist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "putting values from ArrayList to optionlist/dropdownlist" Watch "putting values from ArrayList to optionlist/dropdownlist" New topic
Author

putting values from ArrayList to optionlist/dropdownlist

Priya Yadav
Greenhorn

Joined: Jul 06, 2009
Posts: 2
I am putting arraylist values in 1 dropdown list onclick of radio button, However it is putting "undefined" instead of values. I can not use Javabean since I will have 3 radio buttons.
ArrayList is coming from database.

My JavaScript :


In my JSP I have :

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

Please take the time to choose the correct forum for your posts. This forum is for questions on HTML, not JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.
Priya Yadav
Greenhorn

Joined: Jul 06, 2009
Posts: 2
anyone please ?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Priya,
Welcome to JavaRanch!

positionnames is an array. When you print it out, you don't get the contents of the array. Try doing a 'view source' on the HTML generated by your JSP and looking at that line. It's not what you expect.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: putting values from ArrayList to optionlist/dropdownlist
 
Similar Threads
Dynamic drop down list from an array
Drop Down List do not create when more elements added
Retaining javascript values in jsp
separate data with comma separated values and store them in a array
JSP variable typical problem