如何打开相机将QR码扫描到Google Form字段中? [英] How to open camera to scan QR code into Google Form field?

查看:114
本文介绍了如何打开相机将QR码扫描到Google Form字段中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Google表单来跟踪某些事件的条目.员工和与会者输入其ID号,该ID号将与QR码一起发放.

We use Google Forms to track entry into certain events. Staff and attendees enter their ID number which is handed out with a QR code.

我的任务是设法弄清如何访问iPad的摄像头(我们使用iPad填写表格)来扫描与会者的QR码,并将他们的ID号从代码中输入到表格的正确字段中.

I have been tasked with trying to figure out how we can access the iPads cameras (we use iPads for the forms) to scan attendees' QR codes and have their ID number from the code entered into the correct field in the form.

我相信我们可以以某种方式使用Google Apps脚本,但是我不确定.

I believe we can use Google Apps Script somehow, but I am unsure.

推荐答案

最近与网络应用程序一起使用的iphone对话框的更改使我可以访问一个对话框,该对话框使我可以选择文件上传的来源以及其中的一种选择是相机.我上传了带有对话框显示的应用程序图像.我还包括了我的html,以便您可以看到它只是文件上传.也许这会有所帮助.

A recent change to iphone dialogs for use with webapps provides me with access to a dialog that allows me to choose where a file upload comes from and one of the choices is the camera. I uploaded an image the app with the dialog showing. I also included my html so that you can see that it's just a file upload. Perhaps this will help.

带有对话框的应用图片:

Image of App with Dialog:

这是我的html:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script>
      $(function(){
        google.script.run
        .withSuccessHandler(function(rObj){
          $('#dt').val(rObj.date);
        })
        .initForm();
        
      });
      function fileUploadJs(frmData) {
        var amt=$('#amt').val();
        var vndr=$('#vndr').val();
        var img=$('#img').val();
        if(!amt){
          window.alert('No amount provided');
          $('#amt').focus();
          return;
        }
        if(!vndr) {
          window.alert('No vendor provided');
          $('#vndr').focus();
          return;
        }
        if(!img) {
          window.alert('No image chosen');
          $('#img').focus();
        }
        document.getElementById('status').style.display ='inline';
        google.script.run
        .withSuccessHandler(function(hl){
          document.getElementById('status').innerHTML=hl;
        })
        .uploadTheForm(frmData)
      }
      console.log('My Code');
    </script>
    <style>
      input,textarea{margin:5px 5px 5px 0;}
    </style>
  </head>
   <body>
    <h3 id="main-heading">Receipt Information</h3>
    <div id="formDiv">
      <form id="myForm">
        <br /><input type="date" name="date" id="dt"/>
        <br /><input type="number" name="amount" placeholder="Amount" id="amt" />
        <br /><input type="text" name="vendor" placeholder="Vendor" id="vndr"/>
        <br /><textarea name="notes" cols="40" rows="2" placeholder="NOTES"></textarea>
        <br/>Receipt Image
        <br /><input type="file" name="receipt" id="img" />
        <br /><input type="button" value="Submit" onclick="fileUploadJs(this.parentNode)" />
      </form>
    </div>
  <div id="status" style="display: none">
  <!-- div will be filled with innerHTML after form submission. -->
  Uploading. Please wait...
  </div>  
</body>
</html>

这篇关于如何打开相机将QR码扫描到Google Form字段中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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