I have an addon shared to all domain-users. It opens a sidebar that contains a form.
I want the form to post to another Apps Script (implemented webapp) in a basic client-server fashion. The other script (runs as admin) should do stuff with the user-submitted data.
Script1.html (in addon, any user can run it)
<form id="myForm" method="post" action="https://script.google.com/a/macros/<domain>/s/<script2-id>/exec">
<input name="name" type="text" value=""/>
<input name="message" type="text" value=""/>
<input type="button" value="send" formmethod="post" onclick="google.script.host.close();" />
</form>
Script2 (always runs by same admin)
function doPost(formInfo){
doStuff(formInfo.name,formInfo.message)
}
Is this possible? What am I doing wrong. Can this be done in a secure way?