From 72d08bd153177933d296460137320d67cf0045df Mon Sep 17 00:00:00 2001 From: Jason Fowler Date: Thu, 22 Aug 2013 10:54:19 +0800 Subject: [PATCH] MDL-30839 Accessibility - Focusing on error on submit --- lib/formslib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/formslib.php b/lib/formslib.php index 48b67b8ce80..cd43213f1da 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -2219,7 +2219,7 @@ function validate_' . $this->_formName . '_' . $escapedElementName . '(element) ret = validate_' . $this->_formName . '_' . $escapedElementName.'(frm.elements[\''.$elementName.'\']) && ret; if (!ret && !first_focus) { first_focus = true; - frm.elements[\'id_error_'.$elementName.'\'].focus(); + document.getElementById(\'id_error_'.$elementName.'\').focus(); } ';