我可以使用
获取/访问UI元素的值e.parameter.elementname or app.getElementById(id)
如果我使用UiApps或GUI构建器创建UI,
app.add(app.loadComponent("MyGui"));
app.getElementbyId('textbox1').setText("Hi");
如果我使用,HtmlService.createHtmlOutputFromFile('myPage'); 如何获取在html表单中输入的值 - 元素?
答案 0 :(得分:6)
答案 1 :(得分:5)
使用HtmlService时,您需要重新考虑您的应用主要是基于客户端而不是基于服务器。您可以(在客户端JavaScript中)向任何元素添加更改处理程序并对该值执行某些操作,包括使用google.script.run.myFunction(someValue)调用服务器函数。请在此处查看新用户指南:https://developers.google.com/apps-script/html_service