Skip to content

Commit

Permalink
MDL-30839 Fixing extra line breaks in error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnfwlr committed Aug 22, 2013
1 parent 0c99005 commit 5df7412
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/formslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,8 @@ function qf_errorHandler(element, _qfMsg) {
&& div.className != "error") {
div.className += " error";
linebreak = document.createElement("br");
linebreak.className = "error";
linebreak.id = \'id_error_break_\'+element.name;
errorSpan.parentNode.insertBefore(linebreak, errorSpan.nextSibling);
}
Expand All @@ -2166,6 +2168,10 @@ function qf_errorHandler(element, _qfMsg) {
if (errorSpan) {
errorSpan.parentNode.removeChild(errorSpan);
}
var linebreak = document.getElementById(\'id_error_break_\'+element.name);
if (linebreak) {
linebreak.parentNode.removeChild(linebreak);
}
if (div.className.substr(div.className.length - 6, 6) == " error") {
div.className = div.className.substr(0, div.className.length - 6);
Expand Down Expand Up @@ -2213,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[\''.$elementName.'\'].focus();
frm.elements[\'id_error_'.$elementName.'\'].focus();
}
';

Expand Down

0 comments on commit 5df7412

Please sign in to comment.