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?
|
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.aspxhttp://www.essentialobjects.com/doc/jsdoc.public.web.handlers.dialog_event_handler.aspxThis 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!
|