Below is the code to disable the submit button while the form is submitting to prevent multiple submissions when using a third party service (i.e. NOT Webflow - as these can sometimes be slow to load)
It also gets the “Waiting Text” - i.e. “Sending…” from the Submit Button in Webflow and displays it while the form is submitting.
<script>
// DISABLE THE SUBMIT BUTTON ONCE A FORM HAS BEEN SUBMITTED
$("#wf-form-Job-Application").submit(function (e) {
$(e.target).find('input[type=submit]').attr("disabled", true);
var dataWait = $(e.target).find('input[type=submit]').attr("data-wait");
$(e.target).find('input[type=submit]').attr("value", dataWait);
return true;
});
</script>
I’ve integrated with a form from ActiveCampaign (email service provider). I swapped the UseBasin URL to ActiveCampaign in your script but unfortunately I still cannot seem to make it work.
Hey Jacob - This is coming in a bit late (3 years later) but I had the same problem and fixed it by defining the submit button id and embedding it in the code shared by OP.
My button id is “submit-button” so I added that to the original code shared. Hope this helps!