aspose file tools*
The moose likes Struts and the fly likes difference between html:checkbox and html:multibox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "difference between html:checkbox and html:multibox" Watch "difference between html:checkbox and html:multibox" New topic
Author

difference between html:checkbox and html:multibox

sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
hi all

what is the difference between <html:checkbox> and <html:multibox>.
the first one for single checkbox and the other for group of checkboxes is this correct
please explain

thanks in advance
saiprasanna
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You use <html:checkbox> when you have a single value on your ActionForm that can be either true or false:

Check here if you like JavaRanch <html:checkbox property="likesJavaRanch" value="true" />

You use <html:multibox> when the underlying property in your ActionForm is an array of strings. You then have more than one checkbox to populate that array:

What fruits do you like? apples <html:multibox property="fruits" value="apples"/> oranges <html:multibox property="fruits" value="oranges"/> bananas <html:multibox property="fruits" value="bananas"/>

If all boxes are checked when this form is submitted, the likesJavaRanch property (type boolean) will be true, and the fruits property (type String[]) will contain "apples, "oranges", "bananas"


Merrill
Consultant, Sima Solutions
 
wood burning stoves
 
subject: difference between html:checkbox and html:multibox