Nancy:
If you only want to select one color, why not use radio buttons instead?
You are right in leaving all the names the same - then just do:
String colorChoosen = request.getParameter("color");
and that will give you the color that was selected.
- Joel Filosa
Binary Research, Inc.
-----Original Message-----
From: Nancy Crisostomo Martinez [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 5:54 PM
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