You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2010/03/26 09:24:21 UTC

svn commit: r927727 - /struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js

Author: lukaszlenart
Date: Fri Mar 26 08:24:21 2010
New Revision: 927727

URL: http://svn.apache.org/viewvc?rev=927727&view=rev
Log:
Resolved WW-3295 - display of Ajax-Validation-Errors may fail on Internet Explore

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=927727&r1=927726&r2=927727&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 Fri Mar 26 08:24:21 2010
@@ -100,7 +100,11 @@ function addErrorCSS(e, errorText) {
         errorDiv.setAttribute("className", "errorMessage");//ie hack cause ie does not support setAttribute
         errorDiv.setAttribute("errorFor", elem.id);
         errorDiv.appendChild(error);
-        enclosingDiv.insertBefore(errorDiv, firstCtrNode);
+        if(!firstCtrNode && navigator.appName == 'Microsoft Internet Explorer') {
+          enclosingDiv.insertBefore(errorDiv);
+        } else {
+          enclosingDiv.insertBefore(errorDiv, firstCtrNode);
+        }
     } catch (err) {
         alert("An exception occurred: " + err.name + ". Error message: " + err.message);
     }
@@ -153,4 +157,4 @@ StrutsUtils.showValidationErrors = funct
     if (firstFieldErrorPosition != null && form.elements[firstFieldErrorPosition].focus) {
         form.elements[firstFieldErrorPosition].focus();
     }
-}
\ No newline at end of file
+}