I created a google docs form and made a google script gadget to post the data to the spreadsheet backend of the form and then return a custom html5
confirmation page.
I used HTMLService
, doPost(e)
and doGet(e)
in my script code, and also created 2 html files with my gadget (the form and the confirmation html files).
The gadget it writing the data to the correct spreadsheet; however, it's not returning the correct confirmation html file I created with my gadget. It's returning the confirmation page which is part of the google docs form. A snip of the doPost
portion of my code is below. Does anyone have any ideas how to make it return the custom confirm html file I created instead of the Google docs one?
function doPost(e) {
var template = HtmlService.createTemplateFromFile('confirm.html');
template.entry_0 = e.entry_0;
template.entry_1 = e.entry_1;
template.entry_2 = e.entry_2;
template.entry_3 = e.entry_3;
template.screenshot = e.parameter.screenshot;
return template.evaluate();
}
The form action code line in my form.html file is below.
<form action="<?= "https://docs.google.com/spreadsheet/formResponse?formkey=$mungedformkey" ?>" method="post">