MDL-49783 forms: Collapsed form section is opened on error

This commit is contained in:
Martin Mastny
2015-05-07 08:57:30 +08:00
parent 24a2babdd3
commit eaec9cfec7
10 changed files with 128 additions and 11 deletions
+2
View File
@@ -2229,6 +2229,8 @@ function validate_' . $this->_formName . '_' . $escapedElementName . '(element)
ret = validate_' . $this->_formName . '_' . $escapedElementName.'(frm.elements[\''.$elementName.'\']) && ret;
if (!ret && !first_focus) {
first_focus = true;
Y.Global.fire(M.core.globalEvents.FORM_ERROR, {formid: \''. $this->_attributes['id'] .'\',
elementid: \'id_error_'.$elementName.'\'});
document.getElementById(\'id_error_'.$elementName.'\').focus();
}
';