469,569 Members | 1,507 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,569 developers. It's quick & easy.

How to get Barcode scanner data into Web Application

shivaleela
Hi,

I am new to this barcode programming.My application is i'm working on Kiosk which has barcode scanner and i want to use the information of this scanner into my application. So could anybody tell me what all i will need to get the barcode data into my application. I mean do I need any other ports or devices to connect to barcode scanner and decode the data for my application..

Please help me on this

Leela
Aug 15 '07 #1
3 6728
Plater
7,872 Expert 4TB
I mean do I need any other ports or devices to connect to barcode scanner and decode the data for my application..
Depends on the barcoder. Check with the manufacturer for how to interface to it.
Someone a few days ago had a barcode reader that acted like a keyboard
Aug 15 '07 #2
Depends on the barcoder. Check with the manufacturer for how to interface to it.
Someone a few days ago had a barcode reader that acted like a keyboard

Thanks Plater ...
The Barcode scanner is in built in Kiosk so i dont know which barcoder it is... So i'll check with manufacturer for this ..

Thanks
Leela
Aug 16 '07 #3
Hello,

If your barcode scanner acts like a keyboard (for example if you can just scan something into a text document), you can use this javascript to grab the data and filter it against normal keyboard input.

Barcode scanners that support the keyboard wedge feature usually dump a line break after entering a barcode - this script takes advantage of that. If your scanner does not do this, simply take out the e.which == 13 && section of that if (but then if you type four numbers very quickly, this could be interpreted as a barcode scan).

the function handleScan would be your own javascript function that handles the scan. You can use ajax or regular form submission from here to get the barcode to your back-end.

Let me know if I can be of any further help!

var barcode = '';
var bc_timeout;
function getScan(e) {
if (e.which == 13 && barcode.length > 5) {
handleScan(barcode);
barcode = '';
e.preventDefault();
return;
}

var keynum = e.keyCode;
var keychar = String.fromCharCode(keynum);
if (!isNaN(keychar)) {
barcode += keychar;
clearTimeout(bc_timeout);
bc_timeout = setTimeout('emptyBarcode()', 50);
}
}

function emptyBarcode() {
barcode = '';
}
Aug 22 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

21 posts views Thread by CHANGE username to westes | last post: by
4 posts views Thread by Tom | last post: by
10 posts views Thread by Mudasir Ahmed | last post: by
5 posts views Thread by neilphan | last post: by
2 posts views Thread by Jay | last post: by
4 posts views Thread by madunix | last post: by
4 posts views Thread by djbaker | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.