简体   繁体   English

是否可以将基于Javascript的签名板添加到Google表单中以捕获响应者的签名?

[英]Is there a way to add a Javascript-based Signature Pad to a Google Form to capture a responder's signature?

Is there a way to add in Thomas Bradley's Signature Pad plugin so that someone who is filling out the Google Form would be able to sign the form? 有没有一种方法可以添加Thomas Bradley的Signature Pad插件,以便填写Google表单的人可以签名该表单? Would it be possible to use the HTML Service option to create a custom HTML form web app that can then still upload the responses into a Google Spreadsheet? 是否可以使用HTML服务选项创建自定义HTML表单网络应用,然后仍可以将响应上传到Google电子表格中?

The project I've been asked to look into involves an individual being able to fill out a form but they would also like to be able to capture a signature (essentially a web form replacing paper forms) and they would like to do it all with Google since it is their preferred service. 我被要求研究的项目涉及能够填写表格的个人,但他们也希望能够捕获签名(本质上是用网络表格代替纸质表格),并且他们希望做到这一点。 Google,因为它是他们的首选服务。 They also prefer to use Google Spreadsheets. 他们还更喜欢使用Google Spreadsheets。

I'm very new to Google App Scripts and have a beginner's understanding of Javascript so I may very well misunderstand the uses and potential of Google App Scripts. 我是Google App Script的新手,对Javascript有初学者的了解,因此我很可能会误解Google App Script的用途和潜力。 Any help or advice is much appreciated. 任何帮助或建议,我们将不胜感激。

patt0 is right. patt0是正确的。 Here is a working example... 这是一个有效的例子...

I've added a jQuery signature pad plugin to a Google spreadsheet using Google's HTML Service. 我已经使用Google的HTML服务在Google电子表格中添加了jQuery 签名板插件。 ( http://willowsystems.github.io/jSignature/#/about/ ) http://willowsystems.github.io/jSignature/#/about/

The following example shows a signature pad on a Google Spreadsheet and converts the drawn signature to Base64 vector (image/jSignature;base30) data. 下面的示例显示了Google Spreadsheet上的签名板,并将绘制的签名转换为Base64矢量(image / jSignature; base30)数据。

Here is my code.gs : 这是我的code.gs:

var ss = SpreadsheetApp.getActive();

function openDialog() {
  var html = HtmlService.createHtmlOutputFromFile('index');
  ss.show(html);
}

and here is index.html - - (link in your own Jsignature.js): 这是index.html--(您自己的Jsignature.js中的链接):

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="jSignature.js></script>
<script>
$(document).ready(function() {
    $("#signature1").jSignature();
});
</script>
<div id="signature1"></div>
<button type="button" onclick="$('#signature1').jSignature('clear')">Clear</button>
<button type="button" onclick="alert($('#signature1').jSignature('getData','base30'))">Export</button>

As far as I can see, adding the plugin to a Google Form directly will not be possible. 据我所知,将插件直接添加到Google Form中是不可能的。

Using HTML Service is a good idea and yes indeed it will be possible to get the the data from the form and push it to a spreadsheet, which then can trigger other workflow parts. 使用HTML Service是一个好主意,是的,确实可以从表单中获取数据并将其推送到电子表格,然后触发其他工作流程部分。

The only potential red flag is to find out wether the dependencies for the plugin are compatible HTML Service ( https://developers.google.com/apps-script/guides/html-service-caja ). 唯一可能出现的危险信号是确定插件的依赖项是否为兼容的HTML服务( https://developers.google.com/apps-script/guides/html-service-caja )。

Let me know if you need more direction. 让我知道您是否需要更多指导。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM