-
Bug
-
Resolution: Fixed
-
Minor
-
2.0.4, 2.1.1, 2.2
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_20_STABLE, MOODLE_21_STABLE
-
wip-mdl-28987
-
MDL-27728 provided a way to skip over elements the formslib failed to find. While this stops the javascript dying and submitting the form erroneously, the form never performs validation on editor type elements.
This is because editor elements we want to check are named name="<elementname>[text]". The javascript validation is only looking for <elementname>.
My proposed fix for this is when generated the validation js, to check if the element type is 'editor' and if so, to append [text] onto the name used in the JS.
Replication instructions:
1. Try editing a form with a editor (one that's required).
2. Submit the form after having filled out all required fields except a required editor field.
3. Form should not be submitted and display error message ("Required") on the editor field.
4. If the page POST'ed at all when submitted, client side validation failed.
When this fails, the form does submit and the server side validation (if any) catches the missing required field(s) and prevents the form submitting.
- caused a regression
-
MDL-33819 focus does not move to (required) empty description on save
-
- Closed
-
- duplicates
-
MDL-28674 Javascript validation does not work in textarea form
-
- Closed
-
- has a non-specific relationship to
-
MDL-27728 javascript form validation library
-
- Closed
-
- has been marked as being related by
-
MDL-29064 "Question text" field in "Embedded answer (cloze)" question should be required text
-
- Closed
-