From df07fead55f4d7692bbca2edfbc9951df86d6c2e Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Fri, 2 Sep 2016 14:14:06 +0800 Subject: [PATCH] MDL-55829 form: Define 'skipClientValidation' as a global JS var Part of MDL-55071 --- lib/formslib.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/formslib.php b/lib/formslib.php index 538ec8e97c3..04252c15fef 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -2200,9 +2200,6 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { $js = ' -var skipClientValidation = false; - - require(["core/event", "jquery"], function(Event, $) { function qf_errorHandler(element, _qfMsg, escapedName) { @@ -2364,7 +2361,9 @@ require(["core/event", "jquery"], function(Event, $) { '; $PAGE->requires->js_amd_inline($js); - return ''; + + // Global variable used to skip the client validation. + return 'var skipClientValidation = false;'; } // end func getValidationScript /**