mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-38356 Forms: Check that the form exists before applying changechecker
Signed-off-by: Andrew Robert Nicols <andrew.nicols@luns.net.uk>
This commit is contained in:
parent
cce0d9a100
commit
7e21ee683b
1 changed files with 5 additions and 0 deletions
|
@ -18,6 +18,11 @@ YUI.add('moodle-core-formchangechecker',
|
||||||
var formid = 'form#' + this.get('formid'),
|
var formid = 'form#' + this.get('formid'),
|
||||||
currentform = Y.one(formid);
|
currentform = Y.one(formid);
|
||||||
|
|
||||||
|
if (!currentform) {
|
||||||
|
// If the form was not found, then we can't check for changes.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Add change events to the form elements
|
// Add change events to the form elements
|
||||||
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'input', this);
|
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'input', this);
|
||||||
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'textarea', this);
|
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'textarea', this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue