RadTextBox and Enter key will not fire DefaultButton

2 posts, 0 answers
  1. Keith
    Keith avatar
    5 posts
    Member since:
    Dec 2011

    Posted 01 Mar 2012 Link to this post

    I have noticed since upgrading my Telerik.Web.UI to 2012.1.215.40 I have not been able to hit enter from a RadTextBox to fire the default button. I have tested it on many pages in my project, and every page is "broken".

    I have made a test page, and the problem occurs with the RadTextbox with or without being wrapped in a RadAjaxPanel.

    EDIT: RadMaskedTextBox and RadNumericTextBox work properly with the enter key. RadDatePicker, RadTimePicker, RadComboBox do not fire the submit button.

    Any idea on how to fix this issue?

    Here is my sample page:
    <%@ Page Language="C#" AutoEventWireup="true" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
            for (int i = 0; i < 10; i++)
                rcb1.Items.Add(new RadComboBoxItem(i.ToString(), i.ToString()));
        protected void btnSubmit_Click(object sender, EventArgs e)
            ltlMessage.Text = DateTime.Now.ToString() + " - Postback Fired.";
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <head runat="server">
            <form id="form1" runat="server">
                <telerik:RadScriptManager ID="rsm1" runat="server"></telerik:RadScriptManager>   
                    <asp:Panel ID="pnlSubmit" runat="server" DefaultButton="btnSubmit">                       
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
                        <telerik:RadTextBox ID="txtText" runat="server"></telerik:RadTextBox><br />
                        <telerik:RadDatePicker ID="rdp1" runat="server"></telerik:RadDatePicker><br />
                        <telerik:RadTimePicker ID="rtp1" runat="server"></telerik:RadTimePicker><br />
                        <telerik:RadComboBox ID="rcb1" runat="server" AllowCustomText="true">                  
                        </telerik:RadComboBox><br />
                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server">
                        </telerik:RadNumericTextBox><br />
                        <telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" Mask="####">
                        </telerik:RadMaskedTextBox><br />
                        <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click"></asp:Button>
                        <br />
                        <asp:Literal ID="ltlMessage" runat="server"></asp:Literal>
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Mar 2012 Link to this post


    Take a look into the following forum thread which discuss the same.
    Problem with DefaultButton in Q1 2012

Back to Top