Say, you want to loop thru all selected checkboxes, and they are defined
like in:
<input type=checkbox name=subjects value="one">
<input type=checkbox name=subjects value="two">
<input type=checkbox name=subjects value="three">
You should use
String[] subjects= request.getParameterValues("subjects");
if (subjects != null)
{
for (int i= 0; i < subjects.length; i++)
{
out.println(subjects[i] + " was selected");
}
}
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Dennis
Sent: Monday, April 03, 2000 1:01 PM
To: [EMAIL PROTECTED]
Subject: checkboxes in a matrix!
Hi all,
I have an html page which displays a selection page in a matrix format.
i.e something like this.( hope the format remains)
A B C D
A chkbox chkbox ...
B chkbox....
C
I have number of checkboxes to select from.How do I identify which checkbox
is selected.How can I recognize each checkbox seperately in the matrix.
Someone please guide.
Regards,
Dennis
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html