Created
July 8, 2020 02:51
-
-
Save rheajt/db0278e66908909f850619716d02f22a to your computer and use it in GitHub Desktop.
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 characters
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 characters
<!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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment