Some changes for XHTML and accessibility compliance

This commit is contained in:
moodler 2004-09-28 09:47:14 +00:00
parent 857e46c39a
commit 72b4e28353
3 changed files with 14 additions and 5 deletions

View file

@ -667,9 +667,15 @@ function popup_form($common, $options, $formname, $selected='', $nothing='choose
$output .= " <option value=\"javascript:void(0)\">$nothing</option>\n";
}
$inoptgroup = false;
foreach ($options as $value => $label) {
if (substr($label,0,2) == '--') {
$output .= ' <optgroup label="'. $label .'"></optgroup>'; // Plain labels
if ($inoptgroup) {
$output .= ' </optgroup>';
} else {
$inoptgroup = true;
}
$output .= ' <optgroup label="'. $label .'">'; // Plain labels
continue;
} else {
$output .= ' <option value="'. $common . $value .'"';
@ -683,6 +689,9 @@ function popup_form($common, $options, $formname, $selected='', $nothing='choose
$output .= '>'. $value .'</option>' . "\n";
}
}
if ($inoptgroup) {
$output .= ' </optgroup>';
}
$output .= '</select>';
$output .= '</form>' . "\n";
@ -3390,4 +3399,4 @@ function print_speller_button () {
echo '<input type="button" value="Check spelling" onclick="openSpellChecker();" />'."\n";
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>
?>