Commit af81911c authored by webchick's avatar webchick
Browse files

#152098 by mgifford: Improve accessibility of radios and checkboxes.

parent 6135b967
......@@ -1548,7 +1548,7 @@ function theme_radio($element) {
$output .= (check_plain($element['#value']) == $element['#return_value']) ? ' checked="checked" ' : ' ';
$output .= drupal_attributes($element['#attributes']) . ' />';
if (!is_null($element['#title'])) {
$output = '<label class="option">' . $output . ' ' . $element['#title'] . '</label>';
$output = '<label class="option" for="' . $element['#id'] . '">' . $output . ' ' . $element['#title'] . '</label>';
}
unset($element['#title']);
......@@ -1976,7 +1976,7 @@ function theme_checkbox($element) {
$checkbox .= drupal_attributes($element['#attributes']) . ' />';
if (!is_null($element['#title'])) {
$checkbox = '<label class="option">' . $checkbox . ' ' . $element['#title'] . '</label>';
$checkbox = '<label class="option" for="' . $element['#id'] . '">' . $checkbox . ' ' . $element['#title'] . '</label>';
}
unset($element['#title']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment