One approach you might consider is trying to use the get method for the first time the 
page is called and then using the post method for each subsequent call. In your JSP 
you could then check to see how the request was sent and react appropriately.


----------
From:   A mailing list about Java Server Pages specification and reference on behalf 
of Karr, David[SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, October 08, 2002 8:03:32 AM
To:     [EMAIL PROTECTED]
Subject:        Re: Checkboxes
Auto forwarded by a Rule

-----Original Message-----
From:   Kenny G. Dubuisson, Jr. [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, October 08, 2002 7:48 AM
To:     [EMAIL PROTECTED]
Subject:        Checkboxes

I have a checkbox question.  I’m trying to retreive a value
from an HTML
checkbox in my JSP code.  I want the checkbox to have 3
states:  1) null
meaning the page is hit the first time; 2) checked with a
value of “Y”; 3)
unchecked with a value of “N”.  What I seem to be getting are
the first two
and not the third.  Instead of showing an unchecked value of
“N”, I get just
a value of null.

If a checkbox is set, you’ll get a request parameter value for it.  If it is not 
checked, you will not get a request parameter value for it.  That’s how it works.  
Your code which reads the request parameter values has to understand that.  If you 
don’t see the parameter, the box wasn’t checked.

--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

"Free price comparison tool gives you the best prices and cash back!"
http://www.bestbuyfinder.com/download.htm

===========================================================================
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