Here's the problem...
I saw this post on the internet, and this is very useful for my day job. so I adapted the code to do what I need.
The problem: in Client Side, I need to show form and the Server Side made the rest of the code, just receiving the values from the client. note: The client-side can't change code from the Script Editor tool.
See the screenshots below to fully understand.
Server Side - Code
Server Side - Form (HTML View)
Server Side - Form (Script Code in HTML to read Values) - similar to the post from Yagisanatode
until here, everything works perfectly, the problem comes when I try to import it to the client Side.
Client-Side - Library Import
Client Side - Code
Client Side - Form (HTML View)
all seems to be working. but when the client hit de submit button. NOTHING WORKS. the function addRegistro(values) on the client-side don't run. also don't run on the server-side!
so, I appreciate the help from the community, to understand why this happens. what I doing wrong?
Change button type from submit to button. it works.
I bet your problem is in the "novoRegistro" function. The function in the library is probably not accessing the current spreadsheet. Google documentation about spreadsheetapp.getUI says "A script can only interact with the UI for the current instance of an open spreadsheet, and only if the script is bound to the spreadsheet.". Try to put the function "novoRegistro" in your application.gs code instead of the library.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.