I created a form which uploads form field data to a Google Sheet and uploads a file to Google Drive. Right now, upon submission, the page is redirected to a new page that says "File uploaded successfully to the google drive url."
I want to redirect to a specific URL. How do I do this?
!!UPDATE 7/20!! I have updated the code as recommended by Jonas W below. However, after checking the debugger, the following error is issued:
"Load denied by X-Frame-Options: https://accounts.google.com/ServiceLogin?service=wise&passive=1209600&continue=https%3A%2F%2Fn-a5ewhrjyamnkpqisqxvdofomdabpix44dfr7wvq-0lu-script.googleusercontent.com%2Fcenterforalternativefuels.org&followup=https%3A%2F%2Fn-a5ewhrjyamnkpqisqxvdofomdabpix44dfr7wvq-0lu-script.googleusercontent.com%2Fcenterforalternativefuels.org does not permit framing."
Any recommendations as to how to work around X-Frame-Options?
Here is the current redirect code at the end of my file upload function:
return "File uploaded successfully" + file.getUrl();
The file upload function is called in the form html file:
<input type="submit" value="Submit"
onclick="this.value='Uploading..';
google.script.run.withSuccessHandler(fileUploaded)
.uploadFiles(this.parentNode);
return false;" style="margin-top: 20px">
And here is the fileUploaded code from the form html file:
<script>
function fileUploaded(status){
window.location="http://centerforalternativefuels.org";
}
</script>