Page 1 of 1

BarCode reader

Posted: Tue Nov 23, 2004 9:37 am
by kanaps
what technology or how can I connect BarCode reader to php code/page?

Please HELP

Thank you,
Kanaps

Posted: Tue Nov 23, 2004 9:43 am
by pickle
My company has a setup where a barcode reader and a keyboard go into a box - that box is plugged into the keyboard jack of a computer. When a barcode is read in, it just goes up on the screen, as if it were typed in on the keyboard. From there, it's simple to make sure the cursor is in an HTML form and submit that to a PHP page.

I see

Posted: Tue Nov 23, 2004 9:50 am
by kanaps
So you mean it is reasonable to have a text/password box and when someone scans the cards the number will go in there and then you press SUBMIT and it will happen.....
Is theres any other better ways of doin it?

Posted: Tue Nov 23, 2004 10:04 am
by pickle
You might even be able to streamline it a bit more. I think our setup detects the number of characters entered into the field, and when there are 10 or so characters, the form is automatically submitted. So, all that needs to be done is scan the barcode, and the page takes care of the rest.

Is this for a point of sale system or some sort of card reader setup?

Posted: Tue Nov 23, 2004 10:15 am
by kanaps
this is for login system. every one will be able to scan the plastic card (but they do not have a keyboard or mouse.. only touch screen and barcode scaner.

Hm.. interesting.
How they did that when it gets to 10(or something) it submits.... Java Script? Have you got any ideas?

Thank you for your help.. it is usefull.

Posted: Tue Nov 23, 2004 10:29 am
by pickle
Well, I think there is a Javascript condition called onKeyPress(). You can have that handler tied to an input text field, and have that call a function. That function can check the length of the string in the calling textfield, and submit the form if it's long enough:

Code: Select all

function checkLength()
{
     var length = get_value_of_calling_field();
     if(length == 10)
     {
          submit_form();
     }
}
...
<input type = "text" name = "barcode" onKeyPress = "checkLength(this)">

Posted: Tue Nov 23, 2004 10:41 am
by kanaps
OK!
Thank you, I think it will work. If something, I'll come back to it.
Thanks
Kanaps :D