Generate own HTML for Google Form

和自甴很熟 提交于 2019-12-07 14:48:02

问题


I like to generate the Google Form using my own template engine. Unfortunatelly in the basic theme you can change only the background image, fonts, color etc is allowed. I like to have a nice HTML page in "bootstrap" style. So far I can see I could do this using Google Script. The script should open the form and generate HTML template (like example below).

Does someone know how to generate correctly this form? Which url to submit should I use? Hidden parameters?

Thanks for any comments.

Code.gs

function doGet() {
  return HtmlService
      .createTemplateFromFile('index')
      .evaluate();
};

function getData() {
  var form = FormApp.openById('....................');
  return form;
}

index.html

<? var data = getData(); ?>
<? var items = data.getItems(); ?>

<form action="https://docs.google.com/forms/d/..................../formResponse" method="POST">
<!-- .................... stands for form id //-->
<ul>
  <? for (var i = 0; i < items.length; i++) { ?>
    <li><?= items[i].getTitle(); ?></li>
  <? } ?>
</ul>
<input type="submit"/>
</form>

回答1:


You can use this Google Form HTML Exporter tool http://stefano.brilli.me/google-forms-html-exporter/ all you have to provide is link to the Google Form.



来源:https://stackoverflow.com/questions/26657894/generate-own-html-for-google-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!