You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sma3har <sm...@yahoo.com> on 2005/11/15 01:08:32 UTC

How to disable a particular selected checkbox in html:multibox


How can I disable a particular checkbox based on a
value in the
selected items. Here is my code.
There are two arraylist of disease and names.

<logic:iterate id="disease" name="AddressForm"
property="diseases">
<logic:iterate id="name" name="AddressForm"
property="names">
<bean:write name="disease" property="label"/>
<html:multibox property="selectedItems" >
</html:multibox>
</logic:iterate>
</logic:iterate>

Someone please help me.


		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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


Re: How to disable a particular selected checkbox in html:multibox

Posted by Laurie Harper <la...@holoweb.net>.
sma3har wrote:
> 
> How can I disable a particular checkbox based on a
> value in the
> selected items. Here is my code.
> There are two arraylist of disease and names.
> 
> <logic:iterate id="disease" name="AddressForm"
> property="diseases">
> <logic:iterate id="name" name="AddressForm"
> property="names">
> <bean:write name="disease" property="label"/>
> <html:multibox property="selectedItems" >
> </html:multibox>
> </logic:iterate>
> </logic:iterate>
> 
> Someone please help me.

 From the documentation [1]:

	"Renders an HTML <input> element of type checkbox, whose "checked" 
status is initialized based on whether the specified value matches one 
of the elements of the underlying property's array of current values.

	"The value to be returned to the server, if this checkbox is selected, 
must be defined by one of the following methods:

     * Specify a value attribute, whose contents will be used literally 
as the value to be returned.
     * Specify no value attribute, and the nested body content of this 
tag will be used as the value to be returned."

So, you need to add either a value attribute or some body content to 
your html:multibox tag so it knows what value to look for in the 
selectedItems array.

L.

[1] http://struts.apache.org/struts-taglib/tlddoc/html/multibox.html


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