struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r912543 - /struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js
Date Mon, 22 Feb 2010 12:14:13 GMT
Author: lukaszlenart
Date: Mon Feb 22 12:14:13 2010
New Revision: 912543

URL: http://svn.apache.org/viewvc?rev=912543&view=rev
Log:
Solved WW-3393 - rewritten findWWCtrlNode() function

Modified:
    struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js

Modified: struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js?rev=912543&r1=912542&r2=912543&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js (original)
+++ struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js Mon Feb
22 12:14:13 2010
@@ -117,15 +117,18 @@
 }
 
 function findWWCtrlNode(enclosingDiv) {
-    for(var elem in enclosingDiv.getElementsByTagName("div")) {
-        if (elem.className && elem.className.match(/(wwlbl|wwctrl)/))
-            return elem
-    }
-    for(var elem in enclosingDiv.getElementsByTagName("span")) {
-        if (elem.className && elem.className.match(/(wwlbl|wwctrl)/))
-            return elem
-    }
-    return enclosingDiv.getElementsByTagName("span")[0];
+   var elems = enclosingDiv.getElementsByTagName("div");
+   for(i = 0; i < elems.length; ++i ) {
+       if (elems[i].className && elems[i].className.match(/(wwlbl|wwctrl)/))
+           return elems[i];
+   }
+
+   elems = enclosingDiv.getElementsByTagName("span");
+   for(i = 0; i < elems.length; ++i ) {
+       if (elems[i].className && elems[i].className.match(/(wwlbl|wwctrl)/))
+           return elems[i];
+   }
+   return enclosingDiv.getElementsByTagName("span")[0];
 }
 
 //find field position in the form



Mime
View raw message