Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
andyarmada CreditAttribution: andyarmada commentedComment #2
andyarmada CreditAttribution: andyarmada commentedComment #3
quicksketchI'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?
As some options, you can enter text in the description field, or make a markup component and place it below the radio buttons.
Comment #4
andyarmada CreditAttribution: andyarmada commentedThanks 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?
Comment #5
quicksketchUnfortunately 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.
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.
Comment #6
andyarmada CreditAttribution: andyarmada commentedThanks 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.
Comment #7
quicksketchClosing after lack of activity.