Thursday, May 24, 2012

jQuery Dialog: don’t close on escape

The default behavior of the jQuery Dialog allows you to close a dialog by using the Escape button. For a specific use case I did not want the user to close the dialog without explicitly specifying a value.


The solution is to change the value of the closeOnEscape setting to false: 

$('#myConfirmDialog').dialog('option', 'closeOnEscape', false ); 

No comments: