Update of /var/cvs/html/mmbase/validation
In directory james.mmbase.org:/tmp/cvs-serv674

Modified Files:
      Tag: MMBase-1_8
        validation.js.jsp 
Log Message:
if no elements at all, also call the validateHook


See also: http://cvs.mmbase.org/viewcvs/html/mmbase/validation


Index: validation.js.jsp
===================================================================
RCS file: /var/cvs/html/mmbase/validation/validation.js.jsp,v
retrieving revision 1.11.2.16
retrieving revision 1.11.2.17
diff -u -b -r1.11.2.16 -r1.11.2.17
--- validation.js.jsp   21 Dec 2007 13:43:31 -0000      1.11.2.16
+++ validation.js.jsp   20 Mar 2008 13:59:35 -0000      1.11.2.17
@@ -10,7 +10,7 @@
  *                              then call validator.setup(window[,root]).
  *
  * @author Michiel Meeuwissen
- * @version $Id: validation.js.jsp,v 1.11.2.16 2007/12/21 13:43:31 michiel Exp 
$
+ * @version $Id: validation.js.jsp,v 1.11.2.17 2008/03/20 13:59:35 michiel Exp 
$
  */
 var validators = new Array();
 
@@ -726,9 +726,9 @@
     if (el == null) {
         el = document.documentElement;
     }
-    this.log("Will validate " + el);
-
     var els = getElementsByClass(el, "mm_validate");
+    this.log("Will validate elements in " + el + " (" + els.length + " 
elements)");
+
     for (var i = 0; i < els.length; i++) {
         var entry = els[i];
         if (entry.type == "textarea") {
@@ -772,6 +772,11 @@
         }
 
     }
+    if (els.length == 0) {
+        if (this.validateHook) {
+            this.validateHook(this.invalidElements == 0);
+        }
+    }
     el = null;
 }
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to