Hi all, I need to change the yii form layout couse I think radiobutton are rendered in a wrong way
Like you can see the deseign is wrong, how can I have radio buttons rendered all in the same line, or one in every line? Like you can see they take too much space!
And I think I will have the same problem with checkbox
There’s the ‘template’ option in the $htmlOptions paramater that lets you specify the html for an individual label/value combination.
However, this brings me to a related question. Is it somehow possible to present radio/checkbox lists in a way that shows (for example) 3 options per line? Or do I need to create my own loop in combination with checkbox() instead of checkboxlist() for this?
Because, the default separator is a new line "<br/>" . And with the last css code you will see like this:
If you modify the option “separator” to the checkboxList to " - " (for example). The last Css code of giang don’t work for you purpose and see like this:
@bobris, your solution works great if you use the normal form type. When you change your form to "wide form" it does not display correctly (all the labels are displayed first followed by all the radio buttons)
I am also having trouble with the “wide-form” when trying to display inline radio button options. The labels end up completely separate from the buttons. Has anyone found a solution for this? I’ll post one if I’m able to figure it out.
Excellent solution, good alternative to having to specify a labelOptions field in every checkboxlist type of form field. You pretty much always want checkboxes and radio buttons to have their label next to them, not on another separate line.