MDL-13766, added hidden elements to make label 'for' attribute happly

This commit is contained in:
Dongsheng Cai
2010-05-31 05:57:35 +00:00
parent dcf9be7f56
commit ce47962ed5
2 changed files with 4 additions and 0 deletions

View File

@@ -152,6 +152,8 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
$html .= $OUTPUT->file_manager($options); $html .= $OUTPUT->file_manager($options);
$html .= '<input value="'.$draftitemid.'" name="'.$elname.'" type="hidden" />'; $html .= '<input value="'.$draftitemid.'" name="'.$elname.'" type="hidden" />';
// label element needs 'for' attribute work
$html .= '<input value="" id="id_'.$elname.'" type="hidden" />';
return $html; return $html;
} }

View File

@@ -82,6 +82,8 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input {
$options = $fp->options; $options = $fp->options;
$str .= $OUTPUT->render($fp); $str .= $OUTPUT->render($fp);
$str .= '<input type="hidden" name="'.$elname.'" id="'.$id.'" value="'.$draftitemid.'" />'; $str .= '<input type="hidden" name="'.$elname.'" id="'.$id.'" value="'.$draftitemid.'" />';
// label element needs 'for' attribute work
$html .= '<input value="" id="id_'.$elname.'" type="hidden" />';
return $str; return $str;
} }