Reading the barcode in the submit function in my form

I have a simple deposit form. In this account, I read the card number through the barcode reader, but this barcode reader calls the send function immediately after putting the value in it. I want to stop the barcode reader from calling the send function, because I have other fields to fill before sending. I want to know how I can stop a barcode reader by sending a request to function j.

+4
source share
2 answers
$(":input").keypress(function(event){
    if (event.which == '10' || event.which == '13') {
        event.preventDefault();
    }
});

I used this jquery to solve my problem in order to prevent sending function call

+4
source

, - , / . . , keydown. , , . Default/stopPropagation, .

.

+1

Source: https://habr.com/ru/post/1531523/


All Articles