Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect after submitting Google Form

I have a custom Google Form i made and an own site. What i need is, after submitting the Google Form, to allow the user access to download a file. This means that you should only be able to access to file if you completed the form.

I have been looking for a way to redirect to a custom URL without showing the URL (so the user cannot copy-paste it and download the file many times) but it is impossible to redirect after the submission (even if the form is embedded).

I even tried to make the form open a pop-up with the file url or something but everything seems impossible to do.

Is there a way to achieve this?

like image 834
TRDrake Avatar asked Jul 04 '18 20:07

TRDrake


People also ask

Can you redirect a Google Form after submission?

Google Forms does not have the option to redirect users to another webpage after submission. You can either customize the confirmation message to include a link so that this link is shown after submission, or use the Formfacade add-on to redirect users automatically to another webpage after submission.

How do I redirect after submitting a form?

If you want to redirect to another page after form submit html, Then you have to provide/Sign the Other pages path inside HTML Form tag's ACTION Attribute. Which will POST/Send your Form data to that Location and Open/Redirect your Users to That Given Web Page.

What happens if you click back after submitting a Google Form?

All Replies Once to press the submit button the data is submitted. The data is not gone if the press the back button. If you redo the form and press submit again then you have submitted the data twice.


1 Answers

<!-- Normal form embed code, add an ID -->
<iframe id="gform" src="https://docs.google.com/forms/d/e/1FAIpQLSeaiWCc598b3beFhYraf4nNsLgG3bXby_Qne93rHy_Mb_8UIA/viewform?embedded=true" width="640" height="487" frameborder="0" marginheight="0" marginwidth="0" style="margin:0 auto; max-width:100%;">Loading…</iframe>

<script type="text/javascript">
var load = 0;

document.getElementById('gform').onload = function(){
    /*Execute on every reload on iFrame*/
    load++;
    if(load > 1){
        /*Second reload is a submit*/
        document.location = "https://www.google.com/search?q=thanks&tbm=isch";
    }
}
</script>
like image 97
Zastrich Avatar answered Oct 11 '22 17:10

Zastrich