Change the layout of drupal radio button

Copy and paste the below code in your template.tpl.php file in theme folder

function theme_radio($variables) {
$element = $variables['element'];
$element['#attributes']['type'] = 'radio';
element_set_attributes($element, array('id', 'name', '#return_value' => 'value'));

if (isset($element['#return_value']) && $element['#value'] !== FALSE && $element['#value'] == $element['#return_value']) {
$element['#attributes']['checked'] = 'checked';
}
_form_set_class($element, array('form-radio'));

return '<input' . drupal_attributes($element['#attributes']) . ' />';
}

Change theme_checkbox with your theme-name for example your theme name is prohcj then change it to prohcj_checkbox

and add your html structure inside return value. Example need to add before checkbox follow below code.

return '<span><input' . drupal_attributes($element['#attributes']) . ' /></span>';



Related Post


Latest Post


Recent Posts Widget

Make sure to never miss a thing...

Get the latest news from the creative industry along with other creative goodies, conveniently delivered to social media.