• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieving list (multiple select on the form) values into servlet!!!

 
karls Bernando
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to retrieve the values selected in a list item (selecting multiple items). How do I retrieve all selected values for that listbox into the servlet? If I try : reqeust.getParameter("listbox"), it returns the first selected value only. How do I get all the selected values?
Help is appreciated.
karls
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String[] myValues = request.getParameterValues("myList");
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
karls,
Javaranch has a naming policy which is strictly enforced. Please read this policy and change your display name to one that conforms if you would like to keep posting here. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic