Here's how to fix it:
In your form style sheet (form.css), set:
input[type=radio] + label, input[type=checkbox] + label { display:inline !important; }
that's it, you're done.
What it does is says anytime you have a radio button with a label element directly after it, make that label inline instead of block, meaning that there won't be a line break.
I would also recommend changing Yii's default checkbox label positioning to before the label.
I would also recommend changing Yii's default checkbox label positioning to before the label.
Is it possible to make the checkboxes listed in multiple columns? For example, 3 columns per row, so if I have a very long checkbox list, it won't result in a very long page.
ReplyDeleteThere is a new css3 property to do this . Check out the spec. Otherwise I believe there is also a jquery plugin
ReplyDeleteIs possible to use custom images instead of radio buttons?
ReplyDeleteuhm?!? why overwriting the default form.css?
ReplyDeleteradioButtonList( $model, 'attribute', dataArray, array(
'separator' => '', // overwriting the line break
'template' => '{input} {label}', // put the label behind
'class' => 'classname', // additional css class
));
in css you can set all styles needed (float, width, padding) for multiple columns. you may also be able to set icons as background images
good job.........
ReplyDeletethat didn't work for me
ReplyDeleteThat works, thanks!
ReplyDelete