JavaScript after scan

JavaScript function calls and methods can be executed after scan. This is basically a <script> </script> block that is called by Scan to Web after a barcode scan.
To try this feature out follow these steps.
Add this script to your web page;
<script>
  function scantowebsubmit() {
    alert('Form submit attempt from JavaScript');
    document.forms[0].submit();
  }
</script>

2. Scan to Web, open JavaScript after scan, clear all the text and have just the following single line function call;
scantowebsubmit();

3. After barcode scan, set to JavaScript (*advanced)

Now scan a barcode. You will see the alert from your function call, then the page will submit.
This is VERY important! JavaScript is CaSe SeNsiTive.
If your script is not working, check the function name capitalization.

Scan to Web
Founder and Developer of Scan to Web. I wrote my first program on an Apple ][+

Leave a Reply

Your email address will not be published. Required fields are marked *