MDL-40308: Fix javascript for lti mod_form
authorDamyon Wiese <damyon@moodle.com>
Thu, 4 Jul 2013 05:20:01 +0000 (13:20 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 4 Jul 2013 05:47:53 +0000 (13:47 +0800)
It was toggling the state of the hidden input - not the checkbox.

mod/lti/mod_form.js

index 117dbf4..ace191a 100644 (file)
 
             var setting, control;
 
-            // Can't look these up by ID as they seem to get random IDs.
-            // Setting an id manually from mod_form made them turn into text boxes.
             var privacyControls = {
-                sendname: Y.one('input[name=instructorchoicesendname]'),
-                sendemailaddr: Y.one('input[name=instructorchoicesendemailaddr]'),
-                acceptgrades: Y.one('input[name=instructorchoiceacceptgrades]')
+                sendname: Y.one('#id_instructorchoicesendname'),
+                sendemailaddr: Y.one('#id_instructorchoicesendemailaddr'),
+                acceptgrades: Y.one('#id_instructorchoiceacceptgrades')
             };
 
             // Store a copy of user entered privacy settings as we may overwrite them