Barcode reader is a common tool used for different type of authentication. Recently I worked in Event management software for a local community. They are going to provide a membership card with a barcode and on the Event venue they want to use it for authentication.
There are some interactive barcode reader that can read the code and put it where your computer is focused and interesting thing is the barcode reader add an ENTER KEY STROCK after putting the coderin the focused field.
It is easy to solve the problem if we put input box in a <form> element because barcode press an enter after reading the code i.e. it submit the form after retrieving the code. See the following code.
<form onsubmit = “return ini()”>
<input type=”text” id=”code_read_box” value=”” />
// Retrieve the code
var code =document.getElementById (‘code_read_box’).value;
// Return false to prevent the form to submit
I used MOTOROLA LS-2208 as a barcode scanner and it worked fine.