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

Auto submit after scan into input text not function, can someone help me ?

This is my code:

<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> 

Please try this:

<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>