mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
21 lines
624 B
JavaScript
21 lines
624 B
JavaScript
function checksubmit(form) {
|
|
var destination = form.formaction.options[form.formaction.selectedIndex].value;
|
|
if (destination == "" || !checkchecked(form)) {
|
|
form.formaction.selectedIndex = 0;
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
function checkchecked(form) {
|
|
var inputs = document.getElementsByTagName('INPUT');
|
|
var checked = false;
|
|
inputs = filterByParent(inputs, function() {return form;});
|
|
for(var i = 0; i < inputs.length; ++i) {
|
|
if (inputs[i].type == 'checkbox' && inputs[i].checked) {
|
|
checked = true;
|
|
}
|
|
}
|
|
return checked;
|
|
} |