remove error class from fields as well stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 02 Jul 2009 14:44:23 +0200
branchstable
changeset 2246 e89c15221a8a
parent 2245 7463e1a748dd
child 2247 9dbbe6a4c9b0
remove error class from fields as well
web/data/cubicweb.edition.js
--- a/web/data/cubicweb.edition.js	Thu Jul 02 13:00:20 2009 +0200
+++ b/web/data/cubicweb.edition.js	Thu Jul 02 14:44:23 2009 +0200
@@ -305,8 +305,9 @@
 }
 
 function _clearPreviousErrors(formid) {
+    jQuery('#' + formid + 'ErrorMessage').remove();
     jQuery('#' + formid + ' span.error').remove();
-    jQuery('div.errorMessage').remove();
+    jQuery('#' + formid + ' .error').removeClass('error');
 }
 
 function _displayValidationerrors(formid, eid, errors) {
@@ -335,7 +336,7 @@
 	    var innernode = UL(null, map(LI, globalerrors));
 	}
 	// insert DIV and innernode before the form
-	var div = DIV({'class' : "errorMessage"});
+	var div = DIV({'class' : "errorMessage", 'id': formid + 'ErrorMessage'});
 	div.appendChild(innernode);
 	jQuery('#' + formid).before(div);
     }