4
I’m making a form, where data is entered by scanning barcodes (default code 128).
After scanning each value, the handheld scanner is already set to give a <TAB>
and go to the next field, making it very practical in the repetitive use of this form.
But the ENTER has to be via keyboard. Losing that sequence of agile registrations. So I thought about creating a barcode, with a sequence of values in which through a javascript function I would understand that that is a sign of ENTER, ex: In the code it would be '+++++ Jquery would understand this sequence and would make the form Submit.
But unfortunately it didn’t work, because Jquery in my function can only understand the first key and not the sequence.
$(document).bind('keydown', '+++++', function (e) {
alerte('teste');
$('form#myForm').submit();
});
Or is there a way to make a special barcode for shipping?
Example in Fiddle https://fiddle.jshell.net/tvdpL6xe/
I don’t understand what you tried to do, if you will create a bar code, don’t just check it and run the function
ENTER
based on that?– Rafael Augusto
I tried to make a barcode with the +++++ sequence or any other character.. and then jquery would understand Keydown and trigger a Submit.. I’ll try to edit to make it clearer
– Dorathoto
Not enough after . Blur() gives a Trigger('click') on target element ?
– AnthraxisBR
Just a curiosity: when the scanner reads the bars and throws the numbers into the input, what event does the script detect (change, keydown, keyup....)? Obg!
– Sam
then the barcode scanner, works like a usb keyboard.. vc scans the code and it plays the string in the field with focus.. being the same keyboard process, keydown, keyup. etc
– Dorathoto