Connecting Tech Pros Worldwide Forums | Help | Site Map

How to get listbox values in servlet

Newbie
 
Join Date: Oct 2008
Location: Bangalore
Posts: 9
#1: Oct 8 '08
Hi all,
Please help me,
can any one tell me how to get list box values in servlet.
i have used :
Expand|Select|Wrap|Line Numbers
  1. <Select name="lstProjectmem" size="5" class="txbEnabledText" multiple="multiple" onChange="javascript  isplay(this)"/ >
  2. <option selected>..........PROJECT MEMBERS..........</option> </select>
  3.  
and in servlet i wrote,
Expand|Select|Wrap|Line Numbers
  1. String prjmem[] = request.getParameterValues("lstProjectmem");
to get list box values, but i am unable to get the values.
Please help me ...
thank you in advance!

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Oct 8 '08

re: How to get listbox values in servlet


This is a Java problem, so I've moved this thread for you to the Java forum. Please ensure all threads are posted in the most relevant forum. Thanks.

All I can say (not related to your problem though) is that in your onchange, you don't need "javascript" - just call the function.
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#3: Oct 8 '08

re: How to get listbox values in servlet


request.getParameterValues is the correct way of getting an array as a parameter in a servlet. Perhaps if you post the full select declaraction there might be something wrong with it. e.g Are you sure that select is on the form that is submitted to the servlet?
Reply


Similar Java bytes