Title: Close Window, Dialog, Modal on Keypress Post by: jkdoyle on May 22, 2017, 12:53:48 PM I can't quite figure this one out.
When I open a dialog/window, is there a way to have it close on any keypress? And then once it has closed to stop the keydown/keypress function (so that I can refocus on form elements)? For example, how would I close $("mydialog").dialog(); Thanks jimmy Title: Re: Close Window, Dialog, Modal on Keypress Post by: jarry on May 23, 2017, 07:30:37 AM Listen to the keypress on the dialog, call 'close' method to close the dialog. Please look at this code:
Code: var dlg = $('#dlg'); |