Created
May 19, 2020 07:08
-
-
Save Max-Makhrov/fecdc2ba0c05c9efdbe1db8e21d3ff01 to your computer and use it in GitHub Desktop.
Embed Google Form into Google Apps-Script HTML-Form
This file contains 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 launchTheForm_() { | |
// create a form-template object | |
let html = HtmlService.createTemplateFromFile('form').evaluate().setWidth(650).setHeight(1331); | |
// show the form to user | |
SpreadsheetApp.getUi().showModalDialog(html, ' '); | |
} | |
function onOpen() { | |
var ui = SpreadsheetApp.getUi(); | |
// Or DocumentApp or FormApp. | |
ui.createMenu('My Form') | |
.addItem('Show', 'launchTheForm_') | |
.addToUi(); | |
} |
This file contains 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"> | |
<!-- https://stackoverflow.com/questions/37688873/responsive-iframe-with-fixed-div-beneath-it --> | |
<style> | |
.iframe-wrapper{ | |
position:fixed; | |
top:0;left:0;right:0;bottom:50px; | |
} | |
.iframe-wrapper iframe{ | |
width:100%; | |
height:100%; | |
border:none; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="iframe-wrapper"> | |
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSfuEEIPLCNknDj3yhoNrDrCPt2tEEhbtmtt3Wwrw4qmV20IPA/viewform?embedded=true" width="640" height="1331" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment