AI OnAI Off
When you have the redirect to the confirmation page, why do you need to turn off the loader? Why not just keep it loading, until the redirect hits?
Hi Mari,
You can use Allow multiple submissions from the same IP/cookie option to stop the multiple submission.
I think then you can extend the js and add a disabled attribute on the submit button and removed it when form submitted successfully.
// listen to event when form is about submitting
$$epiforms(".EPiServerForms").on("formsStartSubmitting", function (data) {
//var $formContainer = $('#' + data.workingFormInfo.Id);
//$formContainer.addClass("loading");
$body.addClass('loading');
// find the sbumit button here and add disabled attribute.
// ex- $body.find('.submit').attr("disabled","disabled");
});
// listen to event when form is successfully submitted
$$epiforms(".EPiServerForms").on("formsSubmitted", function (data) {
$body.removeClass('loading');
// find the sbumit button here and remove disabled attribute.
});
We have an issue with users submitting the forms multible times. We have implemented a loader as specified here:
https://world.episerver.com/blogs/quan-tran/dates/2019/3/episerver-forms-show-loading-icon/
The issue seem to be that it takes a couple of seconds between "formsSubmitted" event (the loader is turned off) and the redirect to the confirmation page.
Within this period the submit button is enabled and users tend to hit it again....
Does anyone have a good suggestion how to make sure button is not enabed until redirect is done?