Nancy,

You could use the getParameterValues() method, here is the javadoc description:

public java.lang.String[] getParameterValues(java.lang.String name)

Returns an array of String objects containing all of the values the given request 
parameter has, or null if the parameter does not exist.

If the parameter has a single value, the array has a length of 1.

Parameters: name - a String containing the name of the parameter whose value is 
requested
Returns: an array of String objects containing the parameter's values
See Also: getParameter(java.lang.String)

Regards,

Enrique

-----Original Message-----
From: Nancy Crisostomo Martinez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 8:44 AM
To: [EMAIL PROTECTED]
Subject: Reading checkboxes's values


Hi all!
I'm trying to read the value(s) of a checkbox into my JSP file.
I don't know if I'm right but I assign the same name to all the possible

values of the item.

For example:

Select one color:<br>
<input type="checkbox" name="color" value="blue> Blue<br>
<input type="checkbox" name="color" value="red"> Red<br>
<input type="checkbox" name="color" value="white"> White<br>

So I don't know how to get all the values checked in the JSP file which
will recieve this information.
I tried something like this:
String[] colorChoosen = request.getParameter("color");

Or do I have to change the name of the input tag (checkbox) for each
selection to get the value as above?

Please, help me..
Thanks and Regards,
Nancy.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to