酒吧code扫描仪和键盘问题 [英] Bar Code Scanner and Keyboard Issue

查看:197
本文介绍了酒吧code扫描仪和键盘问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

酒吧code扫描仪和键盘。
注:我的酒吧code扫描仪是USB类型。

则...

什么功能必须使用触发键盘,如果我在auto.aspx页面?
我想这code,但没有成功:

  VAR酒吧code =的document.getElementById('吧codeNUM');
酒吧code.addEventListener(键preSS,函数(){警报(请用吧code扫描仪!);的document.getElementById('吧codeNUM')值= ;},真正的);


解决方案

正如@Robert Skarzycki上文所指出的,我怀疑你可以使用网页扫描仪集成。

在关键preSS拦截问题。

这添加到您网页的头部分。

 <脚本类型=文/ JavaScript的>        在window.onload =函数(){
            VAR酒吧code =的document.getElementById('吧codeNUM');
            酒吧code.addEventListener(KEYUP功能(){
                警报(请用吧code扫描仪!);
                。的document.getElementById('吧codeNUM')值=;
            },真正的);
        };    < / SCRIPT>

Bar Code Scanner and Keyboard. NOTE: My Bar Code Scanner is USB Type.

Then...

What function must be use to trigger the keyboard if i'm at auto.aspx page? I tried this code but no success:

var barcode = document.getElementById('barcodenum');
barcode.addEventListener("keypress", function() { alert("Please use Barcode Scanner!"); document.getElementById('barcodenum').value = "";}, true);  

解决方案

As pointed out by @Robert Skarzycki above, i doubt you can integrate with the scanner using a web page.

On the keypress intercept issue.

Add this to the head section of you page.

  <script type="text/javascript">

        window.onload = function() {              
            var barcode = document.getElementById('barcodenum');
            barcode.addEventListener("keyup", function() {
                alert("Please use Barcode Scanner!");
                document.getElementById('barcodenum').value = "";
            }, true);
        };

    </script>

这篇关于酒吧code扫描仪和键盘问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆