Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 963
  • Last Modified:

retrieve checkboxgroup value in jsp

How to retrieve checkboxgroup values sent from one jsp page say <input type="checkbox" name="cbquicklist"> to another jsp page. I have used a group of checkboxes with the same name ="cbquicklist" if i use request.getParameter("cbquicklist"); It returns only the first checkbox value.
0
r_muthu
Asked:
r_muthu
  • 2
1 Solution
 
MalpheusCommented:
Did you try request.getParameterValues("cbquicklist")? Function returns a String[].
0
 
cerebus19Commented:
Don't forget that the browser will only include name/value pair for a checkbox in the response if it's checked.
0
 
COBOLdinosaurCommented:
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
cerebus19Commented:
I think Malpheus's answer was correct, since using getParameterValue() will only return the first value from the HTTP request; his suggestion should have worked, even though r_muthu never indicated whether or not it did.  My point was extremely important, though, in that it is necessary to note that only checked checkboxes return a value; if you don't keep this in mind when writing your code, you may forget to use "false" for any checkbox on the form that didn't return a value.

I think Malpheus deserves most of the credit, and an A, since his answer was absolutely correct to the question that was asked.  I think I deserve an assist, since my point was one that is often overlooked.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now