diff --git a/lib/form/yui/checkboxcontroller/checkboxcontroller.js b/lib/form/yui/checkboxcontroller/checkboxcontroller.js index abcbbbd8476..7543eb57eb1 100644 --- a/lib/form/yui/checkboxcontroller/checkboxcontroller.js +++ b/lib/form/yui/checkboxcontroller/checkboxcontroller.js @@ -100,7 +100,11 @@ YUI.add('moodle-form-checkboxcontroller', function(Y) { controllervaluenode.set('value', '1'); newvalue = 'checked'; } - checkboxes.set('checked', newvalue); + checkboxes.each(function(checkbox){ + if (!checkbox.get('disabled')) { + checkbox.set('checked', newvalue); + } + }); } } }); diff --git a/lib/formslib.php b/lib/formslib.php index 18c0c8989f2..607fdc9664d 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1086,7 +1086,8 @@ abstract class moodleform { if (!is_null($contollerbutton) || is_null($selectvalue)) { foreach ($mform->_elements as $element) { if (($element instanceof MoodleQuickForm_advcheckbox) && - $element->getAttribute('class') == $checkboxgroupclass) { + $element->getAttribute('class') == $checkboxgroupclass && + !$element->isFrozen()) { $mform->setConstants(array($element->getName() => $newselectvalue)); } } diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 90310a99169..06dfcd95a53 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -796,6 +796,9 @@ function checkall() { var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == 'checkbox') { + if (inputs[i].disabled || inputs[i].readOnly) { + continue; + } inputs[i].checked = true; } } @@ -805,6 +808,9 @@ function checknone() { var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == 'checkbox') { + if (inputs[i].disabled || inputs[i].readOnly) { + continue; + } inputs[i].checked = false; } }