For checkbox and radio form elements, when #title_display is set to 'after' (default), input is placed after its label, not inside.

In form-element.func.php, must swap lines 116 and 119:

    case 'after':
      if ($is_radio || $is_checkbox) {
        $output .= ' ' . $prefix . $element['#children'] . $suffix;
      }
      else {
        $variables['#children'] = ' ' . $prefix . $element['#children'] . $suffix;
      }
      $output .= ' ' . theme('form_element_label', $variables) . "\n";
      break;

Must be:

    case 'after':
      if ($is_radio || $is_checkbox) {
        $variables['#children'] = ' ' . $prefix . $element['#children'] . $suffix;
      }
      else {
        $output .= ' ' . $prefix . $element['#children'] . $suffix;
      }
      $output .= ' ' . theme('form_element_label', $variables) . "\n";
      break;
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrded’s picture

Version: 7.x-3.1-beta1 » 8.x-3.x-dev
Status: Needs work » Needs review
FileSize
1.08 KB

There is the patch

Status: Needs review » Needs work

The last submitted patch, 1: bootstrap-2292899-1.patch, failed testing.

mrded’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
FileSize
1.08 KB

Move space between input and text.

mrded’s picture

Status: Needs work » Needs review
hkirsman’s picture

Thank you very much. Works in 7.x-3.0

markhalliwell’s picture

Status: Needs review » Fixed

  • Mark Carver committed 60365b8 on 7.x-3.x authored by mrded
    Issue #2292899 by mrded | stan.ag: Fixed Checkbox and radio inputs are...
mrded’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Tectron’s picture

It works, thank you very much. Coming from https://www.drupal.org/node/2651042