我在使用 HtmlService 创建的 html 表单中调用服务器端 GAS 函数时遇到问题。HtmlService 文档说以下应该有效:
<form id='myForm'>
<input name='myFile' type='file'>
<input name='aField'>
<input type='button' onclick='google.script.run.processForm(this.parentNode)'>
</form>
我正在使用类似的东西:
<form id='approveForm'>
<b>Enter Notes about this Approval : </b>
<br /><br />
<textarea id = 'approvalNotes' rows='10' cols='135'>Enter notes on this approval for future reference...</textarea>
<br /><br />
<b>Request Approved?</b>
<br /><br />
<input name = "decision" type="radio" id = 'rApproval' value='Yes'/>Yes<br />
<input name = "decision" type="radio" id = 'rApproval' value ='No'/>No<br />
<input name = "decision" type= "radio" id = 'rApproval' value='Pending'/>Pending<br />
<br /><br />
<b>Set the Group/List Type : </b>
<br /><br />
<input name = "gltype" type="radio" id = 'glType' value='Group'/>Group<br />
<input name = "gltype" type="radio" id = 'glType' value='List'/>List<br />
<input name = "gltype" type="radio" id = 'glType' value='?'/>?<br />
<br />
<input type='button' value='submit' onclick='google.script.run.processForm(this.parentNode)'>
</form>
尽管我做了几乎与文档所说的用于表单提交相同的事情,但我的服务器端函数没有被调用。有人可以告诉我我可能做错了什么以及我如何能够解决这个问题。