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