Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Barcode Scanner and Web Form Submit

using barcode scanner to fill webform and submit

8:06 am on Dec 11, 2009 (gmt 0)

New User

10+ Year Member

joined:Sept 7, 2004
posts: 7
votes: 0

I have a barcode scanner that is configured to work with a order management system that when scanning a barcode will add ~~~0000 to the front and / to the end of the number.

I have a webform that we use to look up customer orders, product inventory. What I'd like to do is to be able to scan the order number into the form field and it will submit automatically but right now, when we scan a order number 12345 it will give ~~~00012345/

Is there a way to strip away the ~~~, leading 0's, and / and only submit 12345 and add a <enter> to automatically submit the form?

Please advise,


5:45 am on Dec 16, 2009 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member ogletree is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 14, 2003
votes: 42

You could do that with javascript. Have it strip away the numbers you don't want then have it submit form after it does the strip away.
12:47 am on Jan 8, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
votes: 0

Also, you can program the scanner to not add those characters. That sounds like a scanner programming problem.

You can also do it with a script using the onSubmit routine of the Form.
In javascript you can do a box.value = String(v).substr(7,100) which would start at the first real character.

7:22 pm on Mar 4, 2010 (gmt 0)

New User

5+ Year Member

joined:Oct 15, 2009
votes: 0

Either re-setup the barcode reader, or change it on the backend. I don't advise using javascript on the page.