Quantcast
Channel: Question and Answer » markup
Viewing all articles
Browse latest Browse all 40

How to add markup inside a form radio button div

$
0
0

Currently I have a form displaying radio buttons and I added some markup to it by attaching #suffix to the form element. However, I found that this didn’t do exactly what I needed. This created the following code structure:

<div class='field-wrapper'>
  <div class='radio-button-group-wrapper>
     ...
      <div class='radio-button-group-inner-wrapper'>
          <div class='radio-button'>
            <input type='radio'></input>
            <label></label>
          </div>
          <div class='radio-button'>
            <input type='radio'></input>
            <label></label>
          </div>
      </div>
 </div>
 <div>Markup goes here</div>  
</div>

I’m trying to figure out how to add markup inside the ‘radio-button’ div, right after the label tag. How can I do this? If there is no Drupal way of doing it, I can add it with javascript, but that’s not ideal.

EDIT:
I have chosen to try using a custom template for this form element, but its not working. Here is my code:

'my_module_is_member_radios' => array(
  'variables' => array(
    'description' => array(),
  ),
   'template' => 'templates/my_module_is_member_radios',
),

Viewing all articles
Browse latest Browse all 40