From 261c5fb9965da0e69227c1b049e80d8cd3402098 Mon Sep 17 00:00:00 2001 From: Johannes Geppert Date: Fri, 3 Feb 2012 19:44:51 +0000 Subject: [PATCH] WW-3736: Client Validation is broken for Struts2 themes git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1240312 13f79535-47bb-0310-9956-ffa450edef68 --- .../resources/org/apache/struts2/static/utils.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/main/resources/org/apache/struts2/static/utils.js b/core/src/main/resources/org/apache/struts2/static/utils.js index ad837c432..1779ce57a 100644 --- a/core/src/main/resources/org/apache/struts2/static/utils.js +++ b/core/src/main/resources/org/apache/struts2/static/utils.js @@ -24,11 +24,16 @@ var StrutsUtils = {}; // gets an object with validation errors from string returned by // the ajaxValidation interceptor StrutsUtils.getValidationErrors = function(data) { - if(data.indexOf("/* {") === 0) { - return eval("( " + data.substring(2, data.length - 2) + " )"); - } else { - return null; - } + if (typeof data === "object") { + return data; + } + else { + if (data.indexOf("/* {") === 0) { + return eval("( " + data.substring(2, data.length - 2) + " )"); + } else { + return null; + } + } }; StrutsUtils.clearValidationErrors = function(form) {