942
Views
3
Comments
Solved
How to prohibit form submit when using a barcode scanner?
Question

I need to use a barcode scanner to enter data into a input field. When I do this it also submits my form. How can I do this so the form doesn't submit?

UserImage.jpg
Anthony Sitterly
Solution

I found a solution in a similar thread.
I added a hidden button and set its "Is Default" property to True instead of my actual submit button.
Now when I scan a bar code for field entry "which seems to also send an ENTER cmd" it no longer submits my form as the default button is not accessible.

2016-11-20 11-27-52
João Neves

Hi Anthony,

Can you share your module?

2019-09-30 07-35-56
Aurelio Junior

Hi Anthony,

Some barcode scanners send a command after the barcode content that is interpreted as a "Return" or "Enter". This might be the cause of your problem. My suggestion is to configure your scanner not to send this command or to use javascript to intercept and cancel the command (some examples here).

UserImage.jpg
Anthony Sitterly
Solution

I found a solution in a similar thread.
I added a hidden button and set its "Is Default" property to True instead of my actual submit button.
Now when I scan a bar code for field entry "which seems to also send an ENTER cmd" it no longer submits my form as the default button is not accessible.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.