This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between html:checkbox and html:multibox
 
Similar Threads
html:multibox
jsp
difference between checkbox and multibox
How to enable checkbox from value fetched from database
html:mutlibox uncheck ,check problem