MDL-70987 core_form: Use correct id for elementid during validation

The id of the formid was being passed instead of the elementid.
This commit is contained in:
Andrew Nicols
2021-02-24 09:06:48 +08:00
parent 713b28c2a5
commit 78adf434d4
+1 -1
View File
@@ -2488,7 +2488,7 @@ require(["core/event", "jquery"], function(Event, $) {
}
}
// This handles both randomised (MDL-65217) and non-randomised IDs.
$errorid = preg_replace('/^id_/', 'id_error_', $this->_attributes['id']);
$errorid = preg_replace('/^id_/', 'id_error_', $elem->_attributes['id']);
$validateJS .= '
ret = validate_' . $this->_formName . '_' . $escapedElementName.'(frm.elements[\''.$elementName.'\'], \''.$escapedElementName.'\') && ret;
if (!ret && !first_focus) {