Sunday, 5 June 2016

Implement a Javascript Program that to take four text boxes side by side and provider provision to the user to only 4 digits in a text box once 4 digits is completed automatically 5th digit is entered in the next box.

Implement a Javascript Program that to take four text boxes side by side and provider provision to the user to only 4 digits in a text box once 4 digits is completed automatically 5th digit is entered in the next box.





For More Java Script Programs   Seo Veerendra





<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script>    
        function setCursortoNext(currentID,nextControlID)
        {            
            if (currentID.value.length >= currentID.maxLength)
                document.getElementById(nextControlID).focus();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <table>
<tr>
                <td>Enter Your Card Number</td>
                <td>
                    <asp:textbox id="txtFirstSet" maxlength="4" onkeyup="setCursortoNext(this,'txtSecondSet')" runat="server"></asp:textbox>
                    <asp:textbox id="txtSecondSet" maxlength="4" onkeyup="setCursortoNext(this,'txtThirdSet')" runat="server"></asp:textbox>
                    <asp:textbox id="txtThirdSet" maxlength="4" onkeyup="setCursortoNext(this,'txtFourthSet')" runat="server"></asp:textbox>
                    <asp:textbox id="txtFourthSet" maxlength="4" runat="server"></asp:textbox>

                </td>
            </tr>
</table>
</div>
</form>
</body>
</html>



For More Java Script Programs   Seo Veerendra

No comments :

Post a Comment