struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Thompson <elephant...@gmail.com>
Subject Re: checkbox : unchecked elements not in list
Date Fri, 04 Dec 2009 18:50:36 GMT
Unchecked checkboxes in html forms don't submit a value.  If you want true
vs. false submitted back to the Java action, you'll need to use radio
buttons.

-Brian

On Fri, Dec 4, 2009 at 12:31 PM, akoo <ogenium@yahoo.com> wrote:

>
> I have following form
>
> <s:form action="updateAccount">
> <s:iterator value="accounts">
> <s:property name="account"/>
> <s:checkbox name="accountStatus" value=={active}/>
>
> .....
> </s:iterator>
> </s:form>
>
>
>
>
> In my action class I have following
>
> public UpdateAccount account
> {
>        List accountStatus;//list to hold all the checkbox values
>        List accounts; //list to hold all the accounts values
>
>        // getter setters
>
>        public String execute()
>        {
>                //iterate through the list of accounts/
>                //set account status value  to that list accountStatus
>        }
>
> }
>
> Ideally I would want the accountStatus list to contains a list of "true" or
> "false" strings, however accountStatus list only seems to contains only the
> checked
> elements...
> --
> View this message in context:
> http://old.nabble.com/checkbox-%3A-unchecked-elements-not-in-list-tp26636367p26636367.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message