You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brad Reneer <Br...@in2m.com> on 2001/09/19 19:10:19 UTC

RE: wrong behavior of checkboxes in forms?

I'm having the same problem.  Did you ever get this to work?

Thanks,
Bradley Reneer

-----Original Message-----
From: Hartmut Bernecker [mailto:h.bernecker@dhw.de]
Sent: Mon, August 13, 2001 5:17 AM
To: struts-user@jakarta.apache.org
Subject: Re: wrong behavior of checkboxes in forms?


Gregor Rayman schrieb:
> 
> "Hartmut Bernecker" <h....@dhw.de> wrote:
> 
> > Hello,
> >
> > I have a checkbox in a form. If I check it and then submit the form,
> > then I receive the value "true" in the action when calling the method
> > form.getMyCheckbox();
> >
> > But if I uncheck the checkbox and submit the form again, then I receive
> > **again** the value true in the action when calling the method
> > form.getMyCheckbox();
> >
> > Who can help???
> >
> > Hartmut
> 
> Hi, there are two possible solutions:
> 
> 1) use request scope forms
> 2) implement the reset() method. (Which you should do anyway always, when
> you use checkboxes)
> 
> --
> gR


I had implemented the reset() method:

    public void reset(ActionMapping mapping, ServletRequest request)
    {
        myCheckbox = false;
	[...]
    }

But anyway: the problem persists.


Re: wrong behavior of checkboxes in forms?

Posted by Rakesh <ay...@india.com>.
Try to use multibox


Regards,

Rakesh



----- Original Message -----
From: "Brad Reneer" <Br...@in2m.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, September 19, 2001 10:40 PM
Subject: RE: wrong behavior of checkboxes in forms?


> I'm having the same problem.  Did you ever get this to work?
>
> Thanks,
> Bradley Reneer
>
> -----Original Message-----
> From: Hartmut Bernecker [mailto:h.bernecker@dhw.de]
> Sent: Mon, August 13, 2001 5:17 AM
> To: struts-user@jakarta.apache.org
> Subject: Re: wrong behavior of checkboxes in forms?
>
>
> Gregor Rayman schrieb:
> >
> > "Hartmut Bernecker" <h....@dhw.de> wrote:
> >
> > > Hello,
> > >
> > > I have a checkbox in a form. If I check it and then submit the form,
> > > then I receive the value "true" in the action when calling the method
> > > form.getMyCheckbox();
> > >
> > > But if I uncheck the checkbox and submit the form again, then I
receive
> > > **again** the value true in the action when calling the method
> > > form.getMyCheckbox();
> > >
> > > Who can help???
> > >
> > > Hartmut
> >
> > Hi, there are two possible solutions:
> >
> > 1) use request scope forms
> > 2) implement the reset() method. (Which you should do anyway always,
when
> > you use checkboxes)
> >
> > --
> > gR
>
>
> I had implemented the reset() method:
>
>     public void reset(ActionMapping mapping, ServletRequest request)
>     {
>         myCheckbox = false;
> [...]
>     }
>
> But anyway: the problem persists.
>
>