This is a thorny problem.
What I do is pass a ; seperated list of the names of all the
checkboxes on the form as a hidden value to the servlet.
Then the servlet can check for the non-existance of a servlet by
searching the checkbox hidden value for names that aren't in the
parameter names list.
The ones that are in the list are obviously selected.
Hope this helps.
Nic Ferrier
Tapsell-Ferrier Ltd
www.tapsellferrier.co.uk
>>> Jeetandra Mahtani <[EMAIL PROTECTED]> 6/24/99 4:12:29 PM >>>
Hello,
I have a form with several checkboxes. Now, the action of this form
is a servet, in which I
need to see if the checkboxes have been selected. Until now, I have
using the following to
retrieve values from a form:
String opt3 = req.getParameterValues("opt3")[0];
The html for a checkbox is:
<input type="checkbox" name="opt1" value="ON">Add a Complaint<br>
If I retrieve opt1 by
String opt1 = req.getParameterValues("opt1")[0];
I get a nullpointer exception.
Any way by which I could check if a checkbox is selected and retrieve
the value?
Thanks,
Jeetandra
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
___________________________________________________________________________
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