HTML :
<form>
...
<input type=checkbox name=myCheckBox value="Y" >
....
</form>
Java Code to Test if the checkbox is checked :
if (request.getParameter("myCheckBox") != null &&
request.getParameter("myCheckBox").equalsIgnoreCase("Y"))
{
//this will return true if checkBox named myCheckBox is checked
}
else
{
//checkBox named myCheckBox is NOT checked
}
Note : You should only use the getParameter() method if you are sure the
parameter has only one value. If the parameter might have more than one
value, use getParameterValues(java.lang.String). This will return a
String[].
Hope this answers your question
Kishore Raghavan
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Mr. Srinivas Rao
Sent: Saturday, May 13, 2000 1:45 PM
To: [EMAIL PROTECTED]
Subject: Re: Very urgent
can any body help me
how can i get the status(checked or not) of a check box
in a html form in jsp
please help me
E.Srinivas Rao
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets