I'm trying to do a wizard type application with Google Apps Script. Since styling with UiApp is so pain in the rear, I'm trying with the HtmlService route. I can't get the form POST working. Here's my sample code:
// Code.gs
function doGet(e) {
return HtmlService.createHtmlOutputFromFile('p1');
}
function doPost(e) {
var params = Utilities.jsonStringify(e);
var page = HtmlService.createTemplateFromFile('p2');
page.params = params;
return page.evaluate().setSandboxMode(HtmlService.SandboxMode.NATIVE);
}
p1.html
<div>
<form action="#" method="post">
<input type="text" id="myContents"></input>
<input type="submit" value="Submit"></input>
</form>
</div>
p2.html
<div>
<?=params?>
</div>
The output I've gotten from clicking "Submit" on p1 is
{"queryString":null,"parameter":{},"contextPath":"","parameters":{},"contentLength":0}
I'm expecting the form to return data to me so that I can use the data in the consequent page. I'm wondering if this had anything to do with Caja poisoning. Any ideas?