I have a form submit when pressed in which I am showing a small jQuery dialog with a spinning wheel. When I press escape, the dialog closes which is interrupting my form submission. How do I overcome by the user when they press ESC key. How do I prevent the user exiting when the ESC key is pressed for jQuery dialog?
A more reliable solution would be to add your own existence indicator at dialog initialization: $("#popup"). attr("_dialogInitialized", "yes"). dialog( { ... } )
A dialog box is a floating window with a title and content area. This window can be moved, resized, and of course, closed using "X" icon by default. jQueryUI provides dialog() method that transforms the HTML code written on the page into HTML code to display a dialog box.
use the closeOnEscape option
$( ".selector" ).dialog({ closeOnEscape: false });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With