I am using ctools modal window to edit some records with Form API.
How can I prevent closing window with ESC key and the default close button?


I had similar kind of a problem. I had to disable closing modal popup by pressing ESC. In my case solution was adding unbind for modalEventEscapeCloseHandler for page where I was going to get modal popup:

        jQuery(document).unbind("keydown", modalEventEscapeCloseHandler);
      ', 'inline');
  • I have checked. It's not disabling close modal popup with button - ESC – R.Rua Oct 12 '15 at 7:25

I tried like this and it works for me

$(function () {
        show: true,
        keyboard: false,
        backdrop: 'static'

If this won't work for you then try adding


Something like this:

<div class="modal hide fade" data-keyboard="false" 
role="dialog" aria-labelledby="myModalLabel" 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.