Commit 5e5f618d authored by Francois Gannaz's avatar Francois Gannaz
Browse files

Activity form: fix mission selector

parent 5b7c2f3a
......@@ -50,7 +50,7 @@ class mod_labnbook_mod_form extends moodleform_mod {
$missionsList = array_map(
function($x) { return "[{$x->code}] {$x->name}"; },
array_values((array) $missions)
(array) $missions
);
$mform->addElement('header', 'external', "LabNbook");
$mform->addElement(
......@@ -60,7 +60,7 @@ class mod_labnbook_mod_form extends moodleform_mod {
array_merge(['' => "-"], $missionsList),
[
'onchange' => 'javascript: '
. 'document.querySelector("#id_name").value = missions[this.value].name;'
. 'document.querySelector("#id_name").value = missions[parseInt(this.value)].name;'
// try to update the Atto text, but Atto is undocumented stuff (wiki pages are all dead)
. 'document.querySelector("#id_introeditor").innerHTML = missions[this.value].description;'
. 'document.querySelector("#id_introeditoreditable").innerHTML = missions[this.value].description;'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment