Commits

Anonymous committed 255b9bc

WW-1447
- Client-side js validation doesn't work for theme css_xhtml when labelposition is top

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2890573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (1)

src/java/template/css_xhtml/validation.js

 function clearErrorMessages(form) {
 	// clear out any rows with an "errorFor" attribute
 	var divs = form.getElementsByTagName("div");
+	var spans = form.getElementsByTagName("span");
     var paragraphsToDelete = new Array();
 
-    for(var i = 0; i < divs.length; i++) {
-        var p = divs[i];
-        if (p.getAttribute("errorFor")) {
-            paragraphsToDelete.push(p);
-        }
+	if (divs) {
+    	for(var i = 0; i < divs.length; i++) {
+        	var p = divs[i];
+        	if (p.getAttribute("errorFor")) {
+            	paragraphsToDelete.push(p);
+        	}
+    	}
+    }
+    
+    if (spans) {
+    	for (var i = 0; i < spans.length; i++) {
+    		var p = spans[i];
+    		if (p.getAttribute("errorFor")) {
+    			paragraphsToDelete.push(p);
+    		}
+    	}
     }
 
     // now delete the paragraphsToDelete