struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C├ędric Levieux <jordimcl...@gmail.com>
Subject Re: Problem with checkbox
Date Thu, 10 Feb 2005 09:20:26 GMT
Because when you uncheck a checkbox you don't send this field and the
form process let the previous value in place

One of tips of mine is to put a hidden field with the same name and to
see the field as an array : when it contains only one value the
checkbox is unchecked, checked otherwise

Hope it will help,

Cedric


On Tue, 8 Feb 2005 13:58:22 -0800 (PST), Norris Shelton
<norrisshelton@yahoo.com> wrote:
> I have a checkbox drawn by:
> <html:checkbox property="recordTypebooking"
>     onclick="javascript:${recordType.name}BoxDisplay();" />
> ${recordType.description} <br />
> 
> The form is defined as:
> <form-bean name="searchNameForm"
> type="org.apache.struts.validator.LazyValidatorForm" >
>     ...
>     <!-- default recordTypeBooking to booking -->
>     <form-property name="recordTypebooking"
> type="java.lang.Boolean" initial="true"/>
>     ...
> </form-bean>
> 
> The check box displays correct and even defaults.  If I uncheck
> the box and submit, when it failes validation, it is still
> checked.
> 
> =====
> 
> Norris Shelton
> Software Engineer
> Sun Certified Java 1.1 Programmer
> Appriss, Inc.
> ICQ# 26487421
> AIM NorrisEShelton
> YIM norrisshelton
> 
> __________________________________
> Do you Yahoo!?
> Meet the all-new My Yahoo! - Try it today!
> http://my.yahoo.com
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message