Enter key not firing Panel's DefaultButton in IE/Chrome

4 posts, 0 answers
  1. Thad
    Thad avatar
    106 posts
    Member since:
    Sep 2010

    Posted 15 Oct 2010 Link to this post

    We are using RadControls for ASP.NET AJAX version 2010.1.519.40

    When a RadComboBox is inside of a panel with the DefaultButton set and the <enter> key is pressed the default button does not fire in IE or Chrome.  It works in Firefox.

    Here is a sample page with two RadComboBox controls and three buttons inside of a panel that I created to demonstrate this issue:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadComboBox.aspx.cs" Inherits="RadControlsWebApp1.RadComboBox" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
        <script language="javascript" type="text/javascript">
            function logEvent(eventToLog) {
                if (eventToLog == null) {
                    $(".infoArea").html('');
                }
                else {
                    var txt = $(".infoArea").html();
                    txt = eventToLog + '<br>' + txt;
                    $(".infoArea").html(txt);
                }
            }
            function rcbComboBox_ClientKeyPressing(sender, eventArgs) {
                var keyCode = eventArgs.get_domEvent().keyCode;
                logEvent('----------------------------------------------------');
                logEvent('rcbComboBox_ClientKeyPressing (' + sender._uniqueId + ' --> ' + keyCode + ')');
                if (keyCode == 13 && !sender.get_dropDownVisible()) {
                    logEvent('<enter> key pressed while dropdown.visible = false');
                }
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <div>
            <asp:Panel ID="pnlDefault" runat="server" DefaultButton="btnSubmit">
                <telerik:RadComboBox ID="rcbOne" runat="server" OnClientKeyPressing="rcbComboBox_ClientKeyPressing">
                    <Items>
                        <telerik:RadComboBoxItem Text="Item 0" />
                        <telerik:RadComboBoxItem Text="Item 1" />
                        <telerik:RadComboBoxItem Text="Item 2" />
                        <telerik:RadComboBoxItem Text="Item 3" />
                    </Items>
                </telerik:RadComboBox>
                <telerik:RadComboBox ID="rcbTwo" runat="server" OnClientKeyPressing="rcbComboBox_ClientKeyPressing">
                    <Items>
                        <telerik:RadComboBoxItem Text="Item 0" />
                        <telerik:RadComboBoxItem Text="Item 1" />
                        <telerik:RadComboBoxItem Text="Item 2" />
                        <telerik:RadComboBoxItem Text="Item 3" />
                    </Items>
                </telerik:RadComboBox>
                <asp:Button ID="btnOne" runat="server" Text="Button One" OnClientClick="logEvent('btnOne_Click'); return(false);" />
                <asp:Button ID="btnTwo" runat="server" Text="Button Two" OnClientClick="logEvent('btnTwo_Click'); return(false);" />
                <asp:Button ID="btnSubmit" runat="server" Text="Default Button" OnClientClick="logEvent('btnSubmit_Click!!!!'); return(false);" /><br />
                <br />
                <div class="infoArea">
                </div>
            </asp:Panel>
        </div>
        </form>
    </body>
    </html>
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 19 Oct 2010 Link to this post

    Hi Thad,

    Please see this forum thread for a solution to the same issue.

    Sincerely yours,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mick
    Mick avatar
    16 posts
    Member since:
    May 2012

    Posted 18 Jun 2014 in reply to Simon Link to this post

    This link is broken
  5. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 23 Jun 2014 Link to this post

    Hello Mick,

    Indeed the forum thread was removed from the General Discussion topic and it was unavailable. You could find it here :

    http://www.telerik.com/forums/default-button-is-not-working

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top