From 824bf75e56648ed4ce64d4e077ebab5b83903f27 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 26 Mar 2010 08:24:21 +0000 Subject: [PATCH] Resolved WW-3295 - display of Ajax-Validation-Errors may fail on Internet Explore git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@927727 13f79535-47bb-0310-9956-ffa450edef68 --- core/src/main/resources/template/css_xhtml/validation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/template/css_xhtml/validation.js b/core/src/main/resources/template/css_xhtml/validation.js index 848504dcf..65e32eb2e 100644 --- a/core/src/main/resources/template/css_xhtml/validation.js +++ b/core/src/main/resources/template/css_xhtml/validation.js @@ -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 = function(form, errors) { if (firstFieldErrorPosition != null && form.elements[firstFieldErrorPosition].focus) { form.elements[firstFieldErrorPosition].focus(); } -} \ No newline at end of file +}