Merge branch 'MDL-30839-master' of git://github.com/phalacee/moodle
[moodle.git] / lib / formslib.php
index abeb09d..b64bca6 100644 (file)
@@ -2159,6 +2159,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);
     }
 
@@ -2168,6 +2170,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);