mirror of
https://github.com/moodle/moodle.git
synced 2025-04-28 11:55:58 +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
@ -18,6 +18,11 @@ YUI.add('moodle-core-formchangechecker',
|
||||
var formid = 'form#' + this.get('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
|
||||
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'input', this);
|
||||
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'textarea', this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user