-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.2, 3.2 regressions
-
MOODLE_32_STABLE
-
5
The Boost theme does not set id property for some form elements. Therefore, client-side validation fails on some occasions.
Example:
$items = ['' => 'Select', '1' => 'Item 1', '2' => 'Item 2']; |
$mygroup = []; |
$mygroup[] = $form->createElement('select', 'myselect', null, $items); |
$mygroup[] = $form->createElement('link', 'mylink', null, '#', 'Click here'); |
$form->addGroup($mygroup, 'mygroup', 'Select set'); |
$form->addGroupRule('mygroup', array('myselect' => array(array(null, 'required', null, 'client')))); |
Using Boost, users are able to submit the form even if they leave the required field empty.
The reason is in file lib/formslib.php the following line fails:
Y.Global.fire(M.core.globalEvents.FORM_ERROR, {formid: \'' . $this->_attributes['id'] . '\', |
elementid: \'id_error_' . $escapedElementName . '\'}); |
as there is no element with that element id in the page.
This is fine in More or any other non-Boost based themes.
- duplicates
-
MDL-57684 Client side mform validation ignored in the Boost theme
-
- Open
-