mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-67544 form: Ensure that form errors have a unique id
This commit is contained in:
parent
8092e7cfa2
commit
f04c327222
1 changed files with 2 additions and 1 deletions
|
@ -82,7 +82,8 @@ trait templatable_form_element {
|
|||
$context['type'] = $this->getType();
|
||||
$context['attributes'] = implode(' ', $otherattributes);
|
||||
$context['emptylabel'] = ($this->getLabel() === '');
|
||||
$context['iderror'] = preg_replace('/^id_/', 'id_error_', $context['id']);
|
||||
$context['iderror'] = preg_replace('/_id_/', '_id_error_', $context['id']);
|
||||
$context['iderror'] = preg_replace('/^id_/', 'id_error_', $context['iderror']);
|
||||
|
||||
// Elements with multiple values need array syntax.
|
||||
if ($this->getAttribute('multiple')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue