struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Lipofsky" <>
Subject RE: wizard form and checkboxes that won't turn off
Date Wed, 09 Feb 2005 02:22:11 GMT
That's definitely one solution.  The other is to have
an onsubmit method on the form with javascript to
iterate over all the input elements in the form,
find unchecked check-boxes, and create a hidden
input with the same name and a value of "false".
- Dan

> -----Original Message-----
> From: James Mitchell [] 
> Sent: Thursday, February 03, 2005 8:07 PM
> To: Struts Users Mailing List
> Subject: Re: wizard form and checkboxes that won't turn off
> The problem is that the browser submits a value of "on", when 
> you check a 
> checkbox and submit the form.  However, if you uncheck the 
> checkbox and 
> submit the form, the browser does _not_ submit "off" or 
> "false" or anything. 
> So, with your form sitting in session, how will it know that 
> you want it 
> "off"?
> Here's how:  you need to implement reset() method on your 
> form.  In that 
> method you need to set the field that is backing the checkbox 
> to "false" or 
> "off".  When Struts processes the request, it will call reset, then 
> repopulate based on request....effectively giving the 
> _appearance_ that the 
> browser sent "off".
> ----- Original Message ----- 
> From: "Janice" <>
> To: <>
> Sent: Thursday, February 03, 2005 6:32 PM
> Subject: wizard form and checkboxes that won't turn off
> Could somebody please refer me to a solution to this?
> I have a form bean (session-scoped) that is displayed over 3 
> pages.  There
> are "back" and "next" buttons.  Once a checkbox is selected 
> and the user has
> moved to another page, it can't be cleared again.  I have 
> read that this is
> because the checkbox item is now in the session and simply 
> unchecking it
> does not remove it from the session.  What I haven't found is 
> a solution or
> workaround.
> I am using struts 1.1.
> Thanks very much in advance,
> J

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message