> >
> >    request.getParameter("myUncheckedCheckbox") == null
> >
>
> Oh.. yuck.. but thanks David for that work around.  Tried it and it
> works for my purposes.

There are things that can be done to avoid to the ugly null check.

1. Don't initialize check-box fields.  No initial values.
2. Don't use session-scoped forms.

It sounds like you need to start with a blank or default form that has
a check-box checked.  Perhaps the user should receive spam?  :)  I
haven't thought about that case much, but it seems similar in that, if
you don't want to use an initial value for reasons previously
mentioned, you're faced with using some other means to indicate this
box is checked by default.  If you have a "display new form action,"
you can put a value on the form whereby the box will start out
checked.  This is different than defining an initial value.   So long
as you don't specify an initial value for check-box fields, and Struts
creates a new form object for each submission, the state of a
check-box is preserved within an ActionForm.

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

Reply via email to