The following Apps Script uses the Html Service, behaves as expected and displays the response page after the submit button is clicked.
The Problem: If the Apps Script is included into a Google Site (via Insert > Apps Script Gadget) and the form is submitted, the response page doesn't show – nor an error message.
Code.gs
function doGet() {
return HtmlService.createTemplateFromFile('myForm').evaluate();
}
function doPost() {
return HtmlService.createTemplateFromFile('myResponse').evaluate();
}
myForm.html
<html>
<body>
<form action="https://script.google.com/a/macros/.../exec" method="post">
<input type="submit" value="Submit">
</form>
</body>
</html>
myResponse.html
<html>
<body>
<h3>Hello World!</h3>
</body>
</html>
I was able to reproduce this issue. This is due to a long outstanding issue in our issue tracker that is still being worked on around loading non sites.google.com addresses. This is due to security restrictions around frame level URL loading.
The workaround is to change your myForm.html to point to sites.google.com/a/macros rather than script.google.com/a/macros. I confirmed this works both with a public consumer account and a Google Apps enterprise account.
<html>
<body>
<form action="https://sites.google.com/a/macros/.../exec" method="post">
<input type="submit" value="Submit">
</form>
</body>
</html>