Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
482
Auto Tab from WebTextEdit
posted

I am using C#, .Net2.0 and Infragistics 7.1. I want to make a License entry field where there are 4 infragistics text boxes each with maxlength = 4. I want to know if there is a property that I can use so that the user does not have to enter tab to go from one box to the other when the user has reached the max length.

I need to incorporate this feature soon. Please reply asap.

 Thanks!

Parents
No Data
Reply
  • 28464
    Verified Answer
    posted

    Hello,

    Yes, this is perfectly doable using the CSOM (client-side object model) of the WebTextEdit product. The idea is to use the client-side TextChanged event, check the length of the text typed and if it is 4, set focus to the second editor. Here is some sample code:

        <igtxt:WebTextEdit ID="WebTextEdit1" runat="server" MaxLength="4">
            <ClientSideEvents TextChanged="TextChangedHandler" />
        </igtxt:WebTextEdit>
       
        <igtxt:WebTextEdit ID="WebTextEdit2" runat="server" MaxLength="4">
        </igtxt:WebTextEdit>
       
        <script language="javascript">
       
        function TextChangedHandler(editor, newValue)
        {
            var editor1 = igedit_getById("<%= WebTextEdit1.ClientID %>");
            var editor2 = igedit_getById("<%= WebTextEdit2.ClientID %>");
           
           
            if (newValue.length >= 4)
                editor2.focus();
           
        }
       
        </script>

    More info on CSOM can be found in our online help located here:

    http://help.infragistics.com/NetAdvantage/NET/2008.2/CLR3.5/

    Hope this helps. 

Children