I am using a similar technique as was presented in this previously asked question: how to get value entered in UI created with the new HtmlService However, I am seeing inconsistent behavior between web browsers and even on mobile. My problem is in some browsers (Chrome) my 2nd html page is not displaying, however, in Firefox it does. I went so far as to use the same code was was presented by Eric Koleda in the above link. This is what I have:
function doGet(e) {
var t = HtmlService.createTemplateFromFile('page1.html');
t.action = ScriptApp.getService().getUrl();
return t.evaluate();
}
function doPost(e) {
Logger.log("In doPost = ");
var t = HtmlService.createTemplateFromFile('page2.html');
t.name = e.parameter.name;
t.comment = e.parameter.comment;
t.screenshot = e.parameter.screenshot;
return t.evaluate();
}
page1.html
<html>
<body>
<h1>Feedback Form</h1>
<form action="<?= action ?>" method="post">
Name: <input type="text" name="name" /><br/>
Comment:<br/>
<textarea name="comment"></textarea><br/>
<input type="submit" value="Submit" />
</form>
</body>
</html>
page2.html
<html>
<body>
<h1>Thanks</h1>
<p>Thank you for your feedback.</p>
Name: <?= name ?><br/>
Comment: <?= comment ?><br/>
</body>
</html>
Eric's code from his link runs fine in Chrome for me, so I am not sure why I am having this issue. Also, based on Corey G's comment in the above link, I am wondering if I should be using Templated HTML and just use HTML Service only, but Templated HTML seems to be a good fit for my app. Could it be related to my sites or something else? Thanks for your time. Larry King