diff --git a/common/js/xml_js_filter.js b/common/js/xml_js_filter.js index ea46bc304..d77b4149e 100644 --- a/common/js/xml_js_filter.js +++ b/common/js/xml_js_filter.js @@ -66,17 +66,20 @@ var Validator = xe.createApp('Validator', { // hook form submit event $('form') .each(function(){ - if (this.onsubmit) { - this['xe:onsubmit'] = this.onsubmit; - this.onsubmit = null; + if (this.onsubmit && !this.xe_js_filter_controlled) { + this.xe_js_filter_controlled = true; + if(!$.isFunction(this.onsubmit)) { + this['xe:onsubmit'] = this.onsubmit; + this.onsubmit = null; + } } }) .submit(function(){ var legacyFn = this['xe:onsubmit']; var hasLegacyFn = $.isFunction(legacyFn); - var bResult = hasLegacyFn?legacyFn.apply(this):self.run(this); + var bResult = hasLegacyFn?false:self.run(this); - return false; + return bResult; }); }, API_VALIDATE : function(sender, params) {