欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ASP.NET實(shí)現(xiàn)License Key輸入功能的小例子

 更新時(shí)間:2013年03月16日 14:38:31   作者:  
當(dāng)我們安裝微軟的軟件,多數(shù)軟件是需要輸入license key。它有五個(gè)文本框,輸入完第一個(gè)文本框之后,光標(biāo)自動(dòng)跳至下一個(gè)文本框。 Insus.NET今天也使用asp.net來模仿一個(gè)。呵呵。

 

這個(gè)演示,在輸入時(shí),是不需要與服務(wù)端交互,只有全部輸入完畢之后,用戶點(diǎn)銨鈕才進(jìn)行驗(yàn)證。因此在這里,寫Javascript來實(shí)現(xiàn)即可。

js:

復(fù)制代碼 代碼如下:

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


Html code:

復(fù)制代碼 代碼如下:

  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>

相關(guān)文章

最新評(píng)論