Why is it when I set "closeOnEscape" to false and then "closeOnEscape" to true jquery dialog escape

Posted by chobo2 on Stack Overflow See other posts from Stack Overflow or by chobo2
Published on 2010-06-08T20:09:05Z Indexed on 2010/06/08 20:12 UTC
Read the original article Hit count: 147

Filed under:
|

Hi

I am using jquery ui 1.8 and I have a model dialog that popups up and if a user clicks on a checkbox another one comes up.

This requires them to say "yes" or "no" so I removed the "X" on the dialog and put closeOnEscape to false.

However I noticed when I did that the model dialog underneath it would close when they hit escape. So now when the one that pops up when the checkbox is checked I disable closeOnEscape on the first dialog box.

When they close it I enable again yet it does not work. I am not sure why

$("#Dialog").dialog( "option", "closeOnEscape", true);

I even do this in firebug. I just open my first dialog up

Do this in firebugs console

$("#Dialog").dialog( "option", "closeOnEscape", false);

Then verify that escape is now disabled. I then try to enable it again

$("#Dialog").dialog( "option", "closeOnEscape", true);

Yet it never enables.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui