From b38bc3ce3c2319d4518f1fac7a3a07f776150c87 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 19 Jun 2014 17:09:57 +0200 Subject: [PATCH] LSform : fixed JS bug leaving previous errors messages in form in case of multiple submit with errors --- public_html/includes/js/LSform.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public_html/includes/js/LSform.js b/public_html/includes/js/LSform.js index 21d8464c..a96d9994 100644 --- a/public_html/includes/js/LSform.js +++ b/public_html/includes/js/LSform.js @@ -224,8 +224,6 @@ var LSform = new Class({ }); this.LSformAjaxInput.injectInside(this.LSform); - this.resetErrors(); - this.LSform.set('send',{ data: this.LSform, onSuccess: this.onAjaxSubmitComplete.bind(this), @@ -252,6 +250,7 @@ var LSform = new Class({ onAjaxSubmitComplete: function(responseText, responseXML) { var data = JSON.decode(responseText); if ( varLSdefault.checkAjaxReturn(data) ) { + this.resetErrors(); if ($type(data.LSformErrors) == 'object') { data.LSformErrors = new Hash(data.LSformErrors); data.LSformErrors.each(this.addError,this);