You need to always reset them I believe.

Reason:
When your form submits, those checkboxes that are unchecked will not be sent
to the server as parameters.

This means you have no way to detect a user 'unchecking' a checked checkbox.

Solution:
Reset checkbox values to unchecked (false) and Struts will happily set the
ones the user did select to checked (true).  This way, you can accurately
determine which ones the user wants checked.  If you don't use this method,
you wind up not clearing a checked checkbox when the user says to.

HTH,

Eddie

----- Original Message -----
From: "Struts Newsgroup (@Basebeans.com)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 02, 2002 2:25 PM
Subject: Using Reset with Checkboxes


> Subject: Using Reset with Checkboxes
> From: "Ken Holzer" <[EMAIL PROTECTED]>
>  ===
> Hi All,
>
> I am trying to understand how and when to use the reset with checkboxes.
>
> I have seen posting that say when using checkboxes on forms you must reset
> their value to false. When should this be done?
>
> I have a form that contains several checkboxes that get checked when the
> form opens based on some database values (that all is working). But when I
> check or uncheck these and then submit the form how do I see the
checkboxes
> current value?
>
> Sorry if this is something that has already been answered, I searched the
> archive and did not see any specific responses, just to use reset.
>
> Thanks,
>
> Ken Holzer
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to