This is a migrated thread and some comments may be shown as answers.

Auto tab out to button from text box

3 Answers 257 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jagat
Top achievements
Rank 1
Jagat asked on 09 Jul 2018, 03:12 PM

Hi,

My issue and code here:
I have a telerik RadNumeric Text Box and a button.  When i enter 6 digit number in the text box, it should auto tab to button.
I am using "OnKeyUp" to achieve this. The first time i type in the 6 digits into the text box, it auto tabs to the button. After that, if i go back to the text box to enter a new number, after entering a single digit, it auto tabs out. It does not wait till i enter 6 digits to tab out.
I can't figure out why it is tabbing out after entering a single digit. 
NOTE: When i load the page the first time, it works good. It tabs out after entering 6 digits. Every subsequent attempt  to enter a number in that text box, it tabs out after single digit.(No new page load involved). Why is it tabbing out after entering single digit

 

<telerik:RadNumericTextBox ID="txtClientIDSelect" Runat="server" AutoPostBack="false"  
                                DataType="System.Int32" ValidationGroup="Submit"  OnTextChanged="txtClientIDSelect_TextChanged"
                                  MaxLength="6" Width="50px" onkeyup="NumericValue1KeyDown(this,event)"    >
                            <NumberFormat ZeroPattern="n" AllowRounding="False" DecimalDigits="0" DecimalSeparator="#" GroupSeparator=""
                                    GroupSizes="6"></NumberFormat>
                                    
                            </telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator ID="reqClientID" runat="server" ControlToValidate="txtClientIDSelect" ValidationGroup ="Submit"
                    ErrorMessage="ClientID is required." ToolTip="ClientID is required." InitialValue="--Select--"
                    SetFocusOnError="True">*</asp:RequiredFieldValidator>
                           <%-- <asp:TextBox ID="txtClientIDSelect" runat="server"></asp:TextBox>--%>
                              
                            <asp:Button ID="btnSubmitClient" runat="server" Text="SUBMIT" ValidationGroup ="Submit"
                                onclick="btnSubmitClient_Click" />
 
<script type="text/javascript">
                 
            function NumericValue1KeyDown(sender, e) {
            var key = e.keyCode;
            var textCount = 0;
            textCount = document.getElementById('<%= txtClientIDSelect.ClientID %>').value
            //setTimeout(function() { }, 200);
            if(textCount.length >= 6)
            {
             document.getElementById('<%=btnSubmitClient.ClientID %>').disabled = false ;
             document.getElementById('<%=btnSubmitClient.ClientID %>').focus();
            }
            }
</script>

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 12 Jul 2018, 11:44 AM
Hi Jagat,

I tried to reproduce the problem with the latest R2 2018 SP1 version of Telerik.Web.UI.dll but without success. For your convenience I have attached my test project and a video demonstrating my test.

Am I missing something? Is your scenario different?

Please modify the project to demonstrate the issue and send it back.

Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jagat
Top achievements
Rank 1
answered on 19 Jul 2018, 05:12 PM

Rumen, 

I did not get a chance to test your code. 

We moved in a different direction. 

 

Thanks

0
Rumen
Telerik team
answered on 20 Jul 2018, 02:19 PM
Hi Jagat,

OK. Just wanted to note that I replied to your other ticket on the topic: Set focus to textbox, combobox in user control after postback.

Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Jagat
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Jagat
Top achievements
Rank 1
Share this question
or