diff --git a/includes/form.inc b/includes/form.inc index a4d9b68..96d8e2d 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -155,8 +155,9 @@ function bootstrap_form_element_label(&$variables) { // This is also used in the installer, pre-database setup. $t = get_t(); + $is_checkbox = $element['#type'] == 'checkbox'; // If title and required marker are both empty, output no label. - if ((!isset($element['#title']) || $element['#title'] === '' && $element['#type'] !== 'radio' && $element['#type'] !== 'checkbox') && empty($element['#required'])) { + if ((!isset($element['#title']) || $element['#title'] === '' && $element['#type'] !== 'radio' && !$is_checkbox) && empty($element['#required'])) { return ''; } @@ -167,7 +168,7 @@ function bootstrap_form_element_label(&$variables) { $attributes = array(); // Style the label as class option to display inline with the element. - if ($element['#title_display'] == 'after') { + if ($element['#title_display'] == 'after' && !$is_checkbox) { $attributes['class'][] = 'option'; $attributes['class'][] = $element['#type']; }