How to get listbox values in servlet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinodsk101
    New Member
    • Oct 2008
    • 9

    How to get listbox values in servlet

    Hi all,
    Please help me,
    can any one tell me how to get list box values in servlet.
    i have used :
    Code:
    <Select name="lstProjectmem" size="5" class="txbEnabledText" multiple="multiple" onChange="javascript  isplay(this)"/ >
    <option selected>..........PROJECT MEMBERS..........</option> </select>
    and in servlet i wrote,
    Code:
    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!
    Last edited by acoder; Oct 8 '08, 11:02 AM. Reason: Added [code] tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    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.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      request.getPara meterValues 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?

      Comment

      Working...