Welcome Guest Search | Active Topics | Sign In | Register

Help - dialog closes when enter key is pressed Options
Joan Darling
Posted: Monday, May 9, 2016 12:39:45 PM
Rank: Advanced Member
Groups: Member

Joined: 3/9/2010
Posts: 119
I have a dialog with several controls in the ContentTemplate. When the dialog is displayed regardless of which control has focus when the enter key is pressed the dialog closes. Is there a way to disable the enter key for the dialog but leave it available for the controls in the ContentTemplate?
eo_support
Posted: Tuesday, May 10, 2016 12:33:29 PM
Rank: Administration
Groups: Administration

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

Have you tried to handle the dialog's ClientSideOnAccept event and then return 0 from that handler?

http://www.essentialobjects.com/doc/eo.web.dialog.clientsideonaccept.aspx

http://www.essentialobjects.com/doc/jsdoc.public.web.handlers.dialog_event_handler.aspx

This will practically disable the enter key handling on the dialog. However the default enter key behavior in your page would still work. For most pages, the default behavior for enter key is to post back the page, this would have the "side effect" of closing the dialog. Of course, this only works if you do intend to post back the page when enter is pressed. If that's not the intended behavior, then you can put a key down event handler on your top level element in the ContentTemplate to capture enter key and close the dialog with JavaScript.

Thanks!


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.