Pending form response warning after submit

I am submitting data to google sheet via inline form. I am using a stealthy iframe approach to grab the default google redirect to the confirmation page. The form submits a fine, but when I go to leave the page I get a "Waiting for a response form" warning. I am not submitting via ajax, this is a standard submission form and I thought that when the onsubmit function is called, the form response will no longer be deferred?

Any ideas how to prevent this?

EDIT: Added code. The formSubmitted () function hides the form and displays the inline alert.

<iframe name="hidden_iframe" id="hidden_iframe" style="display:none;" onload="if(submitted) {window.location='#'; formSubmitted();}"></iframe>
<form role="form" action="https://docs.google.com/forms/d/my-form-guid/formResponse" method="POST" target="hidden_iframe" onsubmit="submitted=true;">
    ...
</form>

      

+3


source to share


1 answer


I was getting this error when changing the content of my inputs that I was submitting to a form via an iframe.

Specifically, I had the following:

$("#feedback-form").on('submit', function() {
    // Do some processing...

    // Show the user a message their form submitted and clear the inputs so they can submit again.
    $("#form-submitted").removeClass("hidden");
    $("input[name='entry.452983228'").val("");
    $("input[name='entry.455283748'").val("");
    $("input[name='entry.462384982'").val("");  
});

      



My clearing the input in the above code was a problem, I guess because I was clearing the input before submitting the finished processing (and I had a required field in my Google Form).

Finally, maybe check if you are doing something for the form input before it is submitted.

0


source







All Articles