Ok, still you have to know when they're done entering the number. The bar code scanner works just like a keyboard, it just types for you.
So let's say you type in a bunch of numbers, when should you know it's done typing?
If the length of the bar code digits are fixed (e.g. 10 digit number), then the following may be a solution:
Having a javascript look inside the text box every time something is entered (the value is changed), and if it is 10 characters long, validate it, and send it off using AJAX, and then clear the textbox to be ready for the next entry.
If you have variable length product codes, then maybe a time solution. Every 2 seconds the box is checked for a value and is sent off if it's different than the last sent value.
You should have a manual mode, where if the bar code is damaged, the operator can hand type the product code into it and press enter.
Good luck,
Dan