ASP. NET implements the License Key input function, asp. netlicense

Source: Internet
Author: User

ASP. NET implements the License Key input function, asp. netlicense

When we install Microsoft software, most of the software requires entering the license key. It has five text boxes. after entering the first text box, the cursor automatically jumps to the next text box.
Insus. NET today also uses asp.net to imitate one. Haha.

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.

View Code
<script type="text/javascript">        function JumpToNextTextBox(currentTxtBox, nextTextBoxID) {            if (currentTxtBox.value.length >= 5) {                document.getElementById(nextTextBoxID).focus();            }        }    </script>


Html code:

View Code
  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>

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.