为Google表单生成自己的HTML [英] Generate own HTML for Google Form

查看:126
本文介绍了为Google表单生成自己的HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢使用自己的模板引擎生成Google表单.不幸的是,在基本主题中,您只能更改允许的背景图像,字体,颜色等.我喜欢以"bootstrap"样式创建一个漂亮的HTML页面.到目前为止,我可以使用Google脚本执行此操作.该脚本应打开表单并生成HTML模板(如下例所示).

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?

感谢您的任何评论.

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>

推荐答案

您可以使用此Google Form HTML Exporter工具 http://stefano.brilli.me/google-forms-html-exporter/您只需提供指向Google表单的链接即可.

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.

这篇关于为Google表单生成自己的HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆