Results 1 to 4 of 4
  1. #1
    nehakuls is offline Member
    Join Date
    Nov 2009
    Posts
    8
    Rep Power
    0

    Default How to get <select> tag values on other jsp

    --------------------------------------------------------------------------------

    Hi,

    I have created two <select> tags. First is <select name = "a"> having some options. other is <select name = "b">. i am transferring selected values of "a" to "b" on event of a button click.

    upto this it is working fine.

    Now on click OK button my page submitted to the next jsp. On this jsp page I want all the values from "b" on previous page whether they were selected or not.

    I used request.getParameter("b") as well as request.getParameterValues("b").
    Both are returning only first value of "b".

    how can i resolve this.

  2. #2
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    6

    Default

    Check if the first select with name 'a' is in the form tags

  3. #3
    nehakuls is offline Member
    Join Date
    Nov 2009
    Posts
    8
    Rep Power
    0

    Default

    both the <select> "a" and "b" are within the form tag and also selected fields are moving from "a" to "b"

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    They will return only the values that were selected. To submit all of them, either loop through them selecting each one manually using javascript or copy all the values into a javascript array and set it as the value of a hidden input that you submit with the form.

Similar Threads

  1. HashMap contains all values but doesn't show all values
    By xcallmejudasx in forum New To Java
    Replies: 3
    Last Post: 05-10-2009, 11:35 PM
  2. How to retain value in struts 2 using <s:select></s:select> tag
    By SaiPrasad@Sella in forum Web Frameworks
    Replies: 0
    Last Post: 02-09-2009, 07:23 AM
  3. Replies: 0
    Last Post: 05-22-2008, 10:53 AM
  4. Replies: 4
    Last Post: 04-15-2008, 01:04 PM
  5. how to populate html:select with values from database
    By sathya_k_83 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 11-07-2007, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •