Permalink
Browse files

MDL-28737 advcheckboxes toggle state every submit if checkbox_control…

…ler present.
  • Loading branch information...
1 parent 9d228de commit 41977bb4cc75fe82b917df1935a826f2cc6b4bc0 @timhunt timhunt committed Aug 12, 2011
Showing with 1 addition and 10 deletions.
  1. +1 −10 lib/formslib.php
View
@@ -980,15 +980,6 @@ function add_checkbox_controller($groupid, $text = null, $attributes = null, $or
$mform->setType("checkbox_controller$groupid", PARAM_INT);
$mform->setConstants(array("checkbox_controller$groupid" => $new_select_value));
- // Locate all checkboxes for this group and set their value, IF the optional param was given
- if (!is_null($select_value)) {
- foreach ($this->_form->_elements as $element) {
- if ($element->getAttribute('class') == "checkboxgroup$groupid") {
- $mform->setConstants(array($element->getAttribute('name') => $select_value));
- }
- }
- }
-
$checkbox_controller_name = 'nosubmit_checkbox_controller' . $groupid;
$mform->registerNoSubmitButton($checkbox_controller_name);
@@ -997,7 +988,7 @@ function add_checkbox_controller($groupid, $text = null, $attributes = null, $or
if (!defined('HTML_QUICKFORM_CHECKBOXCONTROLLER_EXISTS')) {
$js .= <<<EOS
function html_quickform_toggle_checkboxes(group) {
- var checkboxes = getElementsByClassName(document, 'input', 'checkboxgroup' + group);
+ var checkboxes = document.getElementsByClassName('checkboxgroup' + group);
var newvalue = false;
var global = eval('html_quickform_checkboxgroup' + group + ';');
if (global == 1) {

0 comments on commit 41977bb

Please sign in to comment.