JFormFieldRadio line breaks?

54 views
Skip to first unread message

Craig

unread,
May 4, 2012, 2:01:16 PM5/4/12
to joomla-de...@googlegroups.com
I'm using JFormFieldRadio, and the html looks a little something like:

<input...>
<label>...</label>
<input...>
<label>...</label> 
...

...with no other tags in between, so the radio buttons and labels are all rendered on a single line. I would expect radio buttons to render more like JFormFieldCheckboxes, with list items, so that the checkboxes line up on the left with the labels on the right.

I didn't want to hack this, and I expect I'm missing something that makes this work; how would I fix this?

Matt Thomas

unread,
May 4, 2012, 2:12:32 PM5/4/12
to joomla-de...@googlegroups.com
Sound like CSS could fix this. Maybe something as simple as

input,
label {
    display:block;
}

Best,

Matt Thomas
Founder betweenbrain
Phone: 203.632.9322
Twitter: @betweenbrain





--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/kJRt_MtYVYoJ.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Craig

unread,
May 4, 2012, 3:02:30 PM5/4/12
to joomla-de...@googlegroups.com
CSS wasn't doing it for me - using display:block puts each radio and label on a separate line, and I've never quite understood floats...

Here is what I ended up doing (with Mootools):

$$("fieldset.radio label").each(function (label) {
new Element("br").inject(label, "after");
});

If anyone knows a more standard way, please post. 

Matt Thomas

unread,
May 4, 2012, 3:12:34 PM5/4/12
to joomla-de...@googlegroups.com
Oh, sorry I misunderstood what you where trying to achieve.

With CSS, you could do something like (untested, but should get you close):

fieldset.radio label,
fieldset.radio input {
   float:left;
}

fieldset.radio label {
    clear:left;
}

If you need to support RTL languages, just swap the float and clear left for right.

Best,

Matt Thomas
Founder betweenbrain
Phone: 203.632.9322
Twitter: @betweenbrain




--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/twaFb-BWR-0J.
Reply all
Reply to author
Forward
0 new messages