Bug 24786: (QA follow-up) Reset beenSubmitted on validation failure

When the form submision fails due to validation errors we need to also
reset the preventFormDoubleSubmit state to allow for a second submission
with corrected form fields.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Martin Renvoize 2020-11-06 14:04:49 +00:00 committed by Jonathan Druart
parent f7030fc0e1
commit 47731f187f
1 changed files with 6 additions and 0 deletions

View File

@ -389,6 +389,12 @@
}
}
[% END %]
},
invalidHandler: function(event, validator) {
// reset beenSubmitted for prevenDoubleFormSubmit
event.target.beenSubmitted = false;
// remove class added by preventDoubleFormSubmit
$("body, form input[type='submit'], form button[type='submit'], form a").removeClass('waiting');
}
});
});