Textboxes
電話番号は 3 つあります。Textbox1 max length is 3
、2nd's max length is 3
および3rd max length is 4
。ユーザーが自動的に入力three digits
すると、TextBox3 と同様に同じことが起こります。イベントでこの機能を処理しています。TextBox1
cursor moves
TextBox2
TextBox2
keyup
問題は、押すと
Ctl+a
Ctl+c
Ctl+v
カーソルは、それに到達して next に移動するTextbox3
ため、自動的に移動します。つけておきたい。何か案は?Textbox
Max Length
Textbox
TextBox1
私のコードは以下です。
<asp:TextBox runat="server" ID="tbPh2" MaxLength="3" onkeyup="Mainautotab2(this, 0, event);"/>
<asp:TextBox runat="server" ID="tbPh22" MaxLength="3" onkeyup="Mainautotab2(this, 1, event);"/>
<asp:TextBox runat="server" ID="tbPh222" class="midium" MaxLength="4" />
function Mainautotab2(original, destination, evt) {
if (document.getElementById('<%= tbPh2.ClientID%>').value.length == 3 && document.getElementById('<%= tbPh22.ClientID%>').value.length == 3) {
if (destination == 0)
document.getElementById("<%=tbPh22.ClientID %>").focus();
if (destination == 1)
document.getElementById("<%=tbPh222.ClientID %>").focus();
}
}