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 ][+

3 thoughts on “JavaScript after scan”

  1. Hello, we are a company that has been using your scan to web program for a long time. The iPhone makes good scantowebsubmit() calls. However, on Android phones, scantowebsubmit() function calls do not work at some point. Please refer to the attached scan to web test site and let me know the solution.

  2. Good Morning,
    What a great set of programs you have developed. I am a public school teacher and choir director. I can think of numerous uses for your technology. It is just very cool.

    I have often wondered if there was a way to scan a kid’s ID as they entered the trip bus and prepare a document for submission by email.

    We have always done it by manually clicking on a name and then submitting the form to generate and email. How great it would be to input the info from a scan. I guess that I would need to learn how to trigger a choice response and find the specific kid on a long list (since we can’t predict what order they would show up.

    I am not a programmer so I will keep reading and trying to learn more. If you have a suggested reference site or material, I will gladly read it.

    Here is a screenshot of what I am doing now. I am always willing to learn new things. Thanks for a great product. It has really sparked curiosity.

    https://www.billfew.org/BusCheckPict.jpg

Comments are closed.