Created
July 8, 2020 02:51
-
-
Save rheajt/db0278e66908909f850619716d02f22a to your computer and use it in GitHub Desktop.
Revisions
-
rheajt created this gist
Jul 8, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ function doGet() { var html = HtmlService .createHtmlOutputFromFile('form') .setSandboxMode(HtmlService.SandboxMode.IFRAME) .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); return html; } function submit(name) { SpreadsheetApp.getActive() .getActiveSheet() .appendRow([name, new Date()]); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <div id="demo"> <input id="name" type="text" placeholder="Input your name here..." /> <button id="btn" type="button">Submit</button> </div> <script> function submit(e) { var name = document.getElementById('name').value; google.script.run.submit(name); } document .getElementById('btn') .addEventListener('click', submit); </script> </body> </html>