MDL-34650 - accessibility compliance: Add <label> for form input text and select tag

This commit is contained in:
Rossiani Wijaya
2012-07-31 12:07:16 +08:00
parent 55a568fa7d
commit ecc5cc31ae
8 changed files with 39 additions and 9 deletions
+3 -2
View File
@@ -361,10 +361,11 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
$str .= '<div>';
if (count($formats)>1) {
$str.= html_writer::select($formats, $elname.'[format]', $format, false);
$str .= html_writer::label(get_string('format'), 'menu'. $elname. 'format', false, array('class' => 'accesshide'));
$str .= html_writer::select($formats, $elname.'[format]', $format, false, array('id' => 'menu'. $elname. 'format'));
} else {
$keys = array_keys($formats);
$str.= html_writer::empty_tag('input',
$str .= html_writer::empty_tag('input',
array('name'=>$elname.'[format]', 'type'=> 'hidden', 'value' => array_pop($keys)));
}
$str .= '</div>';