Welcome Guest Search | Active Topics | Sign In | Register

Using Enter key in Dialogs without closing the Dialog? Options
Jan Rygh
Posted: Wednesday, June 24, 2009 6:27:16 AM
Rank: Member
Groups: Member

Joined: 2/9/2009
Posts: 23
Hi,

I want to use keyboard shortcuts in a Dialog to avoid the of mouse clicking. I.e. use the Enter key to make a selection in a textbox. But when I press Enter in the DIalog, the Dialog closes down. I tried to set the attribute EnableKeyBoardNavigation to true without any success. Any clues?

A testpage:
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

    <script type="text/javascript">
function SearchClick() {
  alert('search clicked');
}
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button Text="show dialog" ID="showDialog" runat="server" />
        <eo:Dialog runat="server" ID="Invite_dlg" AllowResize="False" ControlSkinID="none"
            ShowButton="showDialog" BorderWidth="0px" Width="398" Height="602" BackColor="#d8d8d8"
            ShadowDepth="0" AllowMove="false" EnableKeyboardNavigation="true" CancelButton="InviteCancel_btn"
            AnchorElementID="wrapper" ConfineElementID="wrapper" ShowDirection="Bottom">
            <ShowEffect Type="GlideBottomToTop" />
            <CloseEffect Type="GlideBottomToTop" />
            <HeaderStyleActive CssText="display: none" />
            <ContentTemplate>
                <eo:CallbackPanel runat="server" ID="cpInvite" Triggers="{ControlID:Search_btn;Parameter:}">
                    <asp:Panel ID="Search_box_div" DefaultButton="Search_btn" defaultfocus="Search_box"
                        runat="server">
                        <asp:TextBox AccessKey="s" ID="Search_box" runat="server" />
                        <asp:Button ID="Search_btn" Text="Search" runat="server" OnClientClick="SearchClick();return false;"
                            PostBackUrl="#" />
                    </asp:Panel>
                    <asp:Button Text="Cancel" ID="InviteCancel_btn" PostBackUrl="#" runat="server" />
                </eo:CallbackPanel>
            </ContentTemplate>
        </eo:Dialog>
    </div>
    </form>
</body>
</html>
eo_support
Posted: Wednesday, June 24, 2009 9:38:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Please see if this post is what you are looking for:

http://www.essentialobjects.com/forum/postst2652_Dialog-and-TextArea.aspx

Thanks!
Jan Rygh
Posted: Wednesday, June 24, 2009 9:57:36 AM
Rank: Member
Groups: Member

Joined: 2/9/2009
Posts: 23
Yes, thank you, that solved it.
eo_support
Posted: Wednesday, June 24, 2009 10:07:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Cool. Please feel free to let us know if you have any more questions!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.