I made the following command to display a loading every time I submit a project form.
$("button[data-noPreload!='true'][type='submit']").click(openPreloading);
function openPreloading() {
$("#icoCarregando").fadeIn();
}
I found this other code to help fix a crash to close the loading screen when there are errors in completing the form.
$("form").bind("invalid-form.validate", function () {
$("#icoCarregando").hide();
});
So far everything was working fine, the problem I'm in need of help is when the user double-clicks to save a form whose error, the event created above does not seem to work, so Opening the Loading screen, when debugging I was able to identify that the functions created above are being executed, but this seems to be an extra event where loading the loading.
Is there any way to identify which event might be running and causing this problem? Or do you know how to circumvent this failure?
Thank you for your attention!