深圳全飞鸿
标题:
beacon响应扫描枪回车键的实现
[打印本页]
作者:
zhgc
时间:
2020-7-9 11:11
标题:
beacon响应扫描枪回车键的实现
带jQuery的
//将输入框id和按钮id,改成对应的id即可
$("#输入框id").keydown(function(e){
if(e.keyCode == 13){
$("#按钮id").click();
}
});
复制代码
不带jQuery的
<script>
window.onload=function(){
//event : 'keydown',value : this.value, keyCode : event.keyCode
var x = document.getElementById("aa");
if (x.addEventListener) {
x.addEventListener("keydown", function(event) {
if(event.keyCode == 13){
document.getElementById("bb").onclick();
}
});
} else if (x.attachEvent) {// IE 8 及更早 IE 版本
x.attachEvent("onkeydown", function(event) {
if(event.keyCode == 13){
document.getElementById("bb").onclick();
}
});
}
}
</script>
<input id="aa" type=text />
<input id="bb" type=button value ="OK" />
复制代码
作者:
zhgc
时间:
2020-7-9 23:49
最先在泽达实现功能:
{capture name="nagolayer"}
<table class="confont" id="Table2" style="WIDTH: 200px; HEIGHT: 30" cellSpacing="0" cellPadding="0" border="0">
<tr>
<td nowrap style="WIDTH: 10%"> 物料料号 </td>
<td>
{nago_inputbox name="TR_SN" value="" id="TR_SN" mode=1}
</td>
<tr>
<tr><td colspan=4><font color=blue><small><b>请扫描物料的二维码!!</b></small></font></td></tr>
</table>
{/capture}
{capture assign="report_end"}
<script>
callAddEnterTrigger("txtTR_SN","conlayer_IBtnSubmit");
</script>
{/capture}
{include file="{$templete}.html"}
复制代码
欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/)
Powered by Discuz! X3.2