In this demonstration, you do not need to interact with the server during input. You can click the button only after all input is complete. Therefore, you can simply write Javascript here.
Js:
Copy codeThe Code is as follows:
<Script type = "text/javascript">
Function JumpToNextTextBox (currentTxtBox, nextTextBoxID ){
If (currentTxtBox. value. length> = 5 ){
Document. getElementById (nextTextBoxID). focus ();
}
}
</Script>
Html code:
Copy codeThe Code is as follows:
License Key:
<Asp: TextBox ID = "Number1" runat = "server" onkeyup = "JumpToNextTextBox (this, 'number2')" Width = "65"> </asp: TextBox>
-
<Asp: TextBox ID = "Number2" runat = "server" onkeyup = "JumpToNextTextBox (this, 'number3')" Width = "65"> </asp: TextBox>
-
<Asp: TextBox ID = "Number3" runat = "server" onkeyup = "JumpToNextTextBox (this, 'number4')" Width = "65"> </asp: TextBox>
-
<Asp: TextBox ID = "Number4" runat = "server" onkeyup = "JumpToNextTextBox (this, 'number5')" Width = "65"> </asp: TextBox>
-
<Asp: TextBox ID = "Number5" runat = "server" MaxLength = "5" Width = "65"> </asp: TextBox>