mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 22:43:47 +01:00
LSform : fixed JS bug leaving previous errors messages in form in case of multiple submit with errors
This commit is contained in:
parent
5efa437612
commit
b38bc3ce3c
1 changed files with 1 additions and 2 deletions
|
@ -224,8 +224,6 @@ var LSform = new Class({
|
||||||
});
|
});
|
||||||
this.LSformAjaxInput.injectInside(this.LSform);
|
this.LSformAjaxInput.injectInside(this.LSform);
|
||||||
|
|
||||||
this.resetErrors();
|
|
||||||
|
|
||||||
this.LSform.set('send',{
|
this.LSform.set('send',{
|
||||||
data: this.LSform,
|
data: this.LSform,
|
||||||
onSuccess: this.onAjaxSubmitComplete.bind(this),
|
onSuccess: this.onAjaxSubmitComplete.bind(this),
|
||||||
|
@ -252,6 +250,7 @@ var LSform = new Class({
|
||||||
onAjaxSubmitComplete: function(responseText, responseXML) {
|
onAjaxSubmitComplete: function(responseText, responseXML) {
|
||||||
var data = JSON.decode(responseText);
|
var data = JSON.decode(responseText);
|
||||||
if ( varLSdefault.checkAjaxReturn(data) ) {
|
if ( varLSdefault.checkAjaxReturn(data) ) {
|
||||||
|
this.resetErrors();
|
||||||
if ($type(data.LSformErrors) == 'object') {
|
if ($type(data.LSformErrors) == 'object') {
|
||||||
data.LSformErrors = new Hash(data.LSformErrors);
|
data.LSformErrors = new Hash(data.LSformErrors);
|
||||||
data.LSformErrors.each(this.addError,this);
|
data.LSformErrors.each(this.addError,this);
|
||||||
|
|
Loading…
Reference in a new issue