?
Solved

I have a usercontrol with three textboxes how do i make them autojump when each hits the max length?

Posted on 2012-09-18
1
Medium Priority
?
300 Views
Last Modified: 2012-09-26
I have a usercontrol with three textboxes how do i make them autojump when each hits the max length?I have a usercontrol with three textboxes how do i make them autojump when each hits the max length?
0
Comment
Question by:cbrune
1 Comment
 
LVL 20

Accepted Solution

by:
informaniac earned 2000 total points
ID: 38411606
<asp:TextBox ID="txt1" MaxLength="5" runat="server"></asp:TextBox>
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>

Open in new window

txt1.Attributes.Add("onkeyup", "javascript:autojump(this.id,'" + txt2.ClientID + "');");

Open in new window


<script type="text/javascript" language="javascript">
        function autojump(txt1, txt2) {
            var objtxt1 = document.getElementById(txt1);
            var objtxt2 = document.getElementById(txt2);

            if (objtxt1.value.length == objtxt1.maxLength)
                objtxt2.focus();
        }
</script>

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question