I am using a Google form on a web page. I copied the source code from the form directly to my page so that I can modify part of the HTML instead of using an iframe. Then, instead of introducing the user to the answer page with Google docs, I would redirect them to another page.
The problem that I am encountering is with the reconfiguration of the page. I was able to work fine in Chrome and Firefox with this:
<form target="GoogleResponse" action="https://docs.google.com/spreadsheet/ formResponse?formkey=xxxxxxxxxxxxxxxxxxxxxxxxxx&ifq;" onsubmit=" window.location = 'targetPage.html';" method="POST" id="ss-form">
IE and Safari automatically redirected and the response was never written to the Google form. If I drop the redirect, the action works fine in both cases, and the response is written to a Google spreadsheet.
So, I tried to pull the action and instead did everything in onsubmit, like this:
<form target="GoogleResponse" onsubmit="this.action = https://docs.google.com /spreadsheet/formResponse?formkey=xxxxxxxxxxxxxxxxxxxxxxxxxx&ifq'; window.location = 'targetPage.html';" method="POST" id="ss-form">
The same problem as before, IE and Safari are redirected, and nothing is written to the Google spreadsheet. And again, if I remove the redirect, the response will be recorded in all browsers. I can also do other things, for example, throw a warning after an action, and everything continues to work fine. The only time I see a problem is a redirect.
Thus, at this moment I can only understand that this is some kind of conflict between redirection and action. I have fairly limited knowledge of javascript and forms, so any help or recommendations would be greatly appreciated!
javascript html google-spreadsheet google-form google-sheets
strangiato
source share