I got a bit of a strange issue I hope anyone can assist with. The case is really simple. I got a pure HTML with JS site that runs on a local windows 10 kiosk machine.
The site have a input field that takes userId as input and then load next site if the userId exist. The function have been tested by entering the userid manually and by scanning a barcode. This is a kiosk, so the user is provided with a member card, that is being read by a MSR reader that emulates a keybord. The reader have been tested in notepad, and output is good.
When a user swipe the card, expected ID could be 100013. The data the input field gets is 1013. That points to the input field fail to get all the digits when its filled to quickly. As a temporary solution, I had to make a window.prompt() box to catch the input, but that is really not a good solution.
Here is the simple code.
HTML:
<input onblur="this.focus()" class="firstField" autofocus type="text" value="" id="userId" onkeydown="log_in(event)" />
JS function:
function log_in(event){
if (event.keyCode == 13 || event.which == 13){
var tmp = document.getElementById("customerId").value;
document.getElementById("customerId").value = "";
CheckUser(tmp);
}
}