-
Improvement
-
Resolution: Fixed
-
Major
-
3.6
-
MOODLE_36_STABLE
-
MOODLE_37_STABLE
-
MDL-64573-master -
-
Workplace for Moodle 3.7
When we display forms inside modal dialogues we intercept form submission and substitute it with our own callback. As a result client-side form validation is never executed. It is not obvious but if you look at the network inspector you can see that the request is sent to the server and the form errors are returned from the server.
I have also noticed code like this in the modal forms:
https://github.com/moodle/moodle/blob/master/calendar/amd/src/modal_event_form.js#L463-L481
This does not really make much sense. We never execute other listeners for the form submission. This code can be replaced with the following without any changes in functionality:
// When the user clicks the save button save the form.
|
this.getModal().on(CustomEvents.events.activate, SELECTORS.SAVE_BUTTON, function() {
|
this.save();
|
}.bind(this));
|