-
Improvement
-
Resolution: Fixed
-
Major
-
3.7
-
MOODLE_37_STABLE
-
MOODLE_37_STABLE
-
MDL-65217-master -
This issue is similar to MDL-64324 but now it is about the element ids.
Moodleforms create html id for the elements in the format "id_".$elementname
this is unique for the form because all elements have different names (and _generateId() method is overridden in radio inputs to add a suffix).
However when we add several forms on the same page and they have elements with the same name we end up with several elements in the DOM with the same "id" attribute.
First of all, it breaks html validation:
https://www.w3schools.com/tags/att_global_id.asp
> The id attribute specifies a unique id for an HTML element (the value must be unique within the HTML document).
Second, it breaks some JS, for example, 'autocomplete' form element attaches the selector to the wrong element.
- blocks
-
MDL-63070 QuickForms library upgrade
- Closed
- caused a regression
-
MDL-65815 Javascript error when using random element ids
- Closed
-
MDL-66106 Forms with randomised element ids don't support JS validation
- Closed
-
MDL-76013 invalid html code in mforms
- Closed
- has a non-specific relationship to
-
MDL-64324 Form id (html attribute id) collision when forms are loaded in AJAX - all forms have id="mform1"
- Closed
- has been marked as being related by
-
MDL-71336 Dynamic forms use the same id for different date elements
- Closed
-
MDL-64554 Add module for displaying moodleform in a modal window
- Closed