how to get value entered in UI created with the new HtmlService

前端 未结 2 1291
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 03:25

I can get/access the value of the UI elements using,

e.parameter.elementname or app.getElementById(id) 

if i create UI using UiApps or GUI

相关标签:
2条回答
  • 2020-12-06 04:08

    When using HtmlService you need to rethink your app to be primarily client based not server based. You can (in client-side JavaScript) add a change handler to any element and do something with the value, including calling a server function with google.script.run.myFunction(someValue). See the new user guide here: https://developers.google.com/apps-script/html_service

    0 讨论(0)
  • 2020-12-06 04:09

    As an alternative to client-side JavaScript, you can also create simple forms that submit to the doPost() handler which then processes the data. I created a sample script to demonstrate: Run, Source

    0 讨论(0)
提交回复
热议问题