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

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

3 Answers 131 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Thad
Top achievements
Rank 2
Thad asked on 15 Oct 2010, 02:39 PM
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>

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 19 Oct 2010, 04:15 PM
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
0
Mick
Top achievements
Rank 1
answered on 19 Jun 2014, 12:44 AM
This link is broken
0
Nencho
Telerik team
answered on 23 Jun 2014, 12:20 PM
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.

 
Tags
ComboBox
Asked by
Thad
Top achievements
Rank 2
Answers by
Simon
Telerik team
Mick
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or