3
我创建了一个Google文档表单并制作了Google脚本小工具,将数据发布到表单的电子表格后端,然后返回自定义html5
确认页面。HtmlService doPost With Google Docs表单
我在我的脚本代码中使用了HTMLService
,doPost(e)
和doGet(e)
,并且还使用我的小工具(表单和确认html文件)创建了2个html文件。
它将数据写入正确电子表格的小工具;然而,它并没有返回我用我的小工具创建的正确的确认html文件。它返回的是谷歌文档表单的一部分的确认页面。下面是我的代码的doPost
部分的一部分。有没有人有任何想法如何让它返回我创建的自定义确认HTML文件而不是Google文档?
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();
}
form.html文件中的表单动作代码行如下。
<form action="<?= "https://docs.google.com/spreadsheet/formResponse?formkey=$mungedformkey" ?>" method="post">
谢谢,我会试着看看。 – Kinnara