Commits

Anonymous committed 14ea85a

WW-1427
- ajax validation (using dwr) generates js error on firefox when there's a field not defined in *-validation.xml

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

  • Participants
  • Parent commits cfbd657

Comments (0)

Files changed (1)

File src/java/template/ajax/validation.js

 
     if (errors.fieldErrors) {
         for (var fieldName in errors.fieldErrors) {
-            if (form.elements[fieldName].touched) {
-                for (var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
-                    addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]);
-                }
+        	if (form.elements[fieldName]) {
+            	if (form.elements[fieldName].touched) {
+                	for (var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
+                    	addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]);
+                	}
+            	}
             }
         }
     }