gradebook MDL-21513 navigation dropdown in gradebook wasnt working correctly

This commit is contained in:
Andrew Davis 2010-02-05 05:45:02 +00:00
parent a2ec0b8de8
commit 13a3ebca7a

View File

@ -403,9 +403,7 @@ function lockoptionsallsetup(formid) {
/**
* Helper function mainly for drop-down menus' onchange events,
* submits the form designated by args.id. If args.selectid is also
* given, it only submits the form if the selected <option> is not
* the first one (usually the "Choose..." option)
* submits the form designated by args.id.
* Example usage of the html_select component with this function:
* <pre>
* $select = new html_select();
@ -425,12 +423,14 @@ function submit_form_by_id(e, args) {
if (theform.tagName.toLowerCase() != 'form') {
return false;
}
if (args.selectid) {
var select = document.getElementById(args.selectid);
if (select.selectedIndex == 0) {
return false;
}
}
//MDL-21513 the below makes the first option unselectable assuming it will be some sort
//of "Choose..." option. However if there is no placeholder first option the first item is unselectable :(
//if (args.selectid) {
// var select = document.getElementById(args.selectid);
//if (select.selectedIndex == 0) {
// return false;
//}
//}
return theform.submit();
}