我的客户需要扫描一个含有发票号码(5位数)和进入中风的条码。
我需要投入箱,以忽略进入钥匙,并在5个特性之后把重点转移到下一个投入箱。
如果你可以列入一些样本代码,我将不胜感激。 感谢!
我的客户需要扫描一个含有发票号码(5位数)和进入中风的条码。
我需要投入箱,以忽略进入钥匙,并在5个特性之后把重点转移到下一个投入箱。
如果你可以列入一些样本代码,我将不胜感激。 感谢!
$( input[type=text] ).on( keyup , function(e) {
if (e.which != 27 || e.which != 8) { // check for backspace and delete
if (e.which != 13) { // ignoring enter
if (!this.value.replace(/s/g, ).match(/d/g)) { // checking for digit
alert( Insert Digit );
$(this).val( ); // make the field empty
} else {
if (this.value.length > 4) {
$(this).next().focus(); // automatically change current input of length 5 digits
}
}
}
}
});
如果(event.keyCode=13)return不实,(13是进入钥匙),则使用文本框的基末或基调,并添加该代码。
例如,有2个文本箱(TxtBox1和TxtBox2)
<input id="TxtBox1" type="submit" onkeypress="if(event.keyCode==13)return false;document.getElementById( TxtBox2 ).focus(); " name="Submit" value="Send" />
一些JQuery:
$( #test ).keydown(function(e) {
if (e.which == 13) {
if ($(this).val().length == 5) {
e.preventDefault();
$( #test2 ).focus();
}
}
});
体积测试和测试2 是2个文本箱中的id。
不要忽视进入钥匙,而是把它当作你把事情推向一起。 大致如下:
$("#myTextbox").keydown(function(event){
if(event.keyCode == 13){
// validate input and move on to the next textbox
}
});
I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....
I have a div <div id="masterdiv"> which has several child <div>s. Example: <div id="masterdiv"> <div id="childdiv1" /> <div id="childdiv2" /> <div id="...
I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...
<form><input type="file" name="first" onchange="jsFunction(2);"> <input type="file" name="second" onchange="jsFunction(3);"</form> Possible to pass just numbers to the js ...
So I ve got a menu with a hover/selected state and it loads fine in IE6/IE7. However when I scroll down the page and put the element outside of the viewport and then back in I get a broken image! I ...
I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!