This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between html:checkbox and html:multibox

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic