自动提交表单后扫描条形码使用桥式扫描

auto submit form after scan barcode using bridgeit scan

本文关键字:扫描 条形码 提交 表单      更新时间:2023-09-26

扫描后自动提交输入文本不功能,有人能帮我吗?

这是我的代码:

<form role="form" name="form1" class="form-inline " method="post" action="result2.php">
<button type="button" value="Scan" class="btn btn-default btn-success" onclick="bridgeit.scan('scanBtn', 'onAfterCaptureScan');"><span class=" glyphicon glyphicon-qrcode"></span>  Scan barcode</button>
<script type="text/javascript">
    function onAfterCaptureScan(event)  { 
        window.document.form1.find.value = event.value; 
    }
    this.form.submit();
</script> 

请试试:

<form role="form" id="form1" class="form-inline " method="post" action="result2.php">
<input id="value" type="text">
</form>
<button type="button" value="Scan" class="btn btn-default btn-success"    onclick="bridgeit.scan('scanBtn', 'onAfterCaptureScan');"><span class="     glyphicon glyphicon-qrcode"></span>  Scan barcode</button>
<script type="text/javascript">
    function onAfterCaptureScan(event)  { 
        window.document.getElementById('value').value = event.value; 
        window.document.getElementById('form1').submit();
    }
</script>