Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I overwrite the ESC key pressed behavior for jQuery dialog

Tags:

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?

like image 752
Someone Avatar asked Nov 16 '10 17:11

Someone


People also ask

How do you check if jquery dialog is initialized?

A more reliable solution would be to add your own existence indicator at dialog initialization: $("#popup"). attr("_dialogInitialized", "yes"). dialog( { ... } )

What is dialog in jquery?

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.


1 Answers

use the closeOnEscape option

$( ".selector" ).dialog({ closeOnEscape: false }); 
like image 130
superfro Avatar answered Oct 02 '22 15:10

superfro