Is there any way to add text under a select item and not have it automatically add a check box to it?
I've tried any way I can think of and nothing works. Any help would be greatly appreciated.

Comments

andyarmada’s picture

Title: Adding test under select items that are not automatically made into a check box? » Adding text under select items that are not automatically made into a check box?
andyarmada’s picture

Assigned: andyarmada » Unassigned
quicksketch’s picture

I'm not clear what you mean by "not have it automatically add a check box to it". You mean you want to have a list of items where one or more of the items isn't checkable?

Something like this?

My checkboxes:
[  ] Option 1
[  ] Option 2
Option 3?

As some options, you can enter text in the description field, or make a markup component and place it below the radio buttons.

andyarmada’s picture

Thanks quicksketch, what I mean is this:

[ ] Option 1
text: This is text that does not have a check box next to it.
[ ] Option 2
text: This is text that does not have a check box next to it.
[ ] Option 3
text: This is text that does not have a check box next to it.

The way the software is set up, every new line automatically adds radio buttons. How do I add text that does not have a radio button automatically added?

quicksketch’s picture

Unfortunately this isn't an option within Webform. It's not directly supported by Drupal itself, you have to manually theme radio buttons if you want to accomplish what you've requested. For Webform it's an even bigger problem in that there's no place to even put a description for each option.

To accomplish what you want, the only option is to do the custom theming yourself. You can read THEMING.txt to learn how to theme individual Webforms. In the webform-form-[nid].tpl.php file, before you print out anything (I think) you can add a description directly to each radio option.

$form['submitted']['radio_buttons']['option1']['#description'] = 'Description for item 1';
$form['submitted']['radio_buttons']['option2']['#description'] = 'Description for item 2';

But I haven't tried this myself. You might need to be even more manual and render out the individual pieces of the radio buttons.

Update after a little research. No this will not work immediately. Because theme_radio() does not support the #description attribute. However, it would still work if you also over ride theme_radio and check for a #description attribute and print it out if it exists.

andyarmada’s picture

Thanks Quicksketch, I'll try and see if I can make it work somehow. At least I'm heading in the right direction, with your help. If I get it to work, I'll post the results in case someone else needs this in the future.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of activity.