Scanning from webapp, then sending scan result to a form on webpage

Skip to first unread message

Andrew Smith

Sep 4, 2014, 9:42:22 PM9/4/14

I would like to send the result of a scan to a text field on a webpage. I get everything up to the point where it is necessary to pull the {CODE} from the new URL and send it to the page. (Following the instructions here:

I came across two solutions that almost achieve what I want, but not quite and I'll explain why.

___Solution #1: using a cookie___
1. After scan, opens new tab, listing the code scanned and giving user option to confirm or discard the result.
2. On confirm, ports the code back to the original page using a cookie.

Why it doesn't work for me:
1. I'd like to skip the confirmation page. If the scan is incorrect, the user will scan again.
2. Requires internet connectivity to load the new page. If possible, I'd like the solution to be offline-compatible (much like a proper USB barcode reader).

___Solution #2: using a hashchange___
1. Uses a change in the URL hash to capture the code.

Why it doesn't work for me:
1. According to my own experience and others, this solution does not work in Chrome for Android.

Is there a way to collect the scanned code, initiated by calling the Barcode Scanner app from a webpage, and populate it to a form on that page, ideally without additional windows popping up or requiring internet connection?

Please note: I'm a novice. PHP is completely over my head, I don't know how to build a database, and I only know the basics of AJAX. So, a thorough explanation would be so very much appreciated.

Thanks for your help,

Reply all
Reply to author
0 new messages