You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Sayre <ri...@gmail.com> on 2007/10/31 19:28:17 UTC

Submit all Checkboxes

I have a variable amount of check boxes with the same name.  I want to
submit all of the check boxes weather they are checked or not.  Right
now I only get an of array for the ones that are checked.

My form has x number of 'Name' text fields x number of 'Activate'
check boxes for another.

The user will fill in the 'name'  and check the box to 'activate' the
user.  I was using two arrays in my action to store the values of the
check box and the text.  If I could find a way to submit all the check
boxes the arrays would be parallel and I could easily tell which user
name is activated.  Right now I have no way to tell.

Any suggestions?

Thank you,

Rich

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Submit all Checkboxes

Posted by Dave Newton <ne...@yahoo.com>.
If you're using S2's default stack and the S2 checkbox
tags the hidden fields are created for you.

d.

--- "Slattery, Tim - BLS" <Sl...@bls.gov>
wrote:

> > I have a variable amount of check boxes with the
> same name.  
> > I want to submit all of the check boxes weather
> they are 
> > checked or not.  Right now I only get an of array
> for the 
> > ones that are checked.
> 
> Sorry, that's the way HTML works. Checkboxes values
> are sent only when
> the box is checked.
> 
> 
> --
> Tim Slattery
> Slattery_T@bls.gov
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Submit all Checkboxes

Posted by "Slattery, Tim - BLS" <Sl...@bls.gov>.
> I have a variable amount of check boxes with the same name.  
> I want to submit all of the check boxes weather they are 
> checked or not.  Right now I only get an of array for the 
> ones that are checked.

Sorry, that's the way HTML works. Checkboxes values are sent only when
the box is checked.


--
Tim Slattery
Slattery_T@bls.gov


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Submit all Checkboxes

Posted by Dave Newton <ne...@yahoo.com>.
Default stack?

--- Richard Sayre <ri...@gmail.com> wrote:

> I am using struts 2.  Right now when I submit I only
> get the values of
> the checked boxes by default.
> 
> On 10/31/07, Dave Newton <ne...@yahoo.com>
> wrote:
> > Which version of Struts?
> >
> > S2 has this capability built-in.
> > S1 can use the same technique by including a
> hidden
> > form field.
> >
> > d.
> >
> > --- Richard Sayre <ri...@gmail.com> wrote:
> >
> > > I have a variable amount of check boxes with the
> > > same name.  I want to
> > > submit all of the check boxes weather they are
> > > checked or not.  Right
> > > now I only get an of array for the ones that are
> > > checked.
> > >
> > > My form has x number of 'Name' text fields x
> number
> > > of 'Activate'
> > > check boxes for another.
> > >
> > > The user will fill in the 'name'  and check the
> box
> > > to 'activate' the
> > > user.  I was using two arrays in my action to
> store
> > > the values of the
> > > check box and the text.  If I could find a way
> to
> > > submit all the check
> > > boxes the arrays would be parallel and I could
> > > easily tell which user
> > > name is activated.  Right now I have no way to
> tell.
> > >
> > > Any suggestions?
> > >
> > > Thank you,
> > >
> > > Rich
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > >
> > >
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Submit all Checkboxes

Posted by Richard Sayre <ri...@gmail.com>.
I am using struts 2.  Right now when I submit I only get the values of
the checked boxes by default.

On 10/31/07, Dave Newton <ne...@yahoo.com> wrote:
> Which version of Struts?
>
> S2 has this capability built-in.
> S1 can use the same technique by including a hidden
> form field.
>
> d.
>
> --- Richard Sayre <ri...@gmail.com> wrote:
>
> > I have a variable amount of check boxes with the
> > same name.  I want to
> > submit all of the check boxes weather they are
> > checked or not.  Right
> > now I only get an of array for the ones that are
> > checked.
> >
> > My form has x number of 'Name' text fields x number
> > of 'Activate'
> > check boxes for another.
> >
> > The user will fill in the 'name'  and check the box
> > to 'activate' the
> > user.  I was using two arrays in my action to store
> > the values of the
> > check box and the text.  If I could find a way to
> > submit all the check
> > boxes the arrays would be parallel and I could
> > easily tell which user
> > name is activated.  Right now I have no way to tell.
> >
> > Any suggestions?
> >
> > Thank you,
> >
> > Rich
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Submit all Checkboxes

Posted by Dave Newton <ne...@yahoo.com>.
Which version of Struts?

S2 has this capability built-in.
S1 can use the same technique by including a hidden
form field.

d.

--- Richard Sayre <ri...@gmail.com> wrote:

> I have a variable amount of check boxes with the
> same name.  I want to
> submit all of the check boxes weather they are
> checked or not.  Right
> now I only get an of array for the ones that are
> checked.
> 
> My form has x number of 'Name' text fields x number
> of 'Activate'
> check boxes for another.
> 
> The user will fill in the 'name'  and check the box
> to 'activate' the
> user.  I was using two arrays in my action to store
> the values of the
> check box and the text.  If I could find a way to
> submit all the check
> boxes the arrays would be parallel and I could
> easily tell which user
> name is activated.  Right now I have no way to tell.
> 
> Any suggestions?
> 
> Thank you,
> 
> Rich
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org