user3122107
user3122107

Reputation:

Prevent closing of JQuery Popup window

I have the following JQuery popup window in my page.

$('#SubSkill').dialog({
          autoOpen: false,
          draggable: false,
          resizable: false,
          bgiframe: false,
          modal: true,
          width: dWidth,
          height: dHeight,
          title: "Enter Job Sub Skill Information",
          open: function (type, data) {
              $(this).parent().appendTo("form");
          }
      });

When I clisk the Escape key, it closes. How do I prevent the closing of the popup when this key is pressed?

Upvotes: 2

Views: 77

Answers (3)

MusicLovingIndianGirl
MusicLovingIndianGirl

Reputation: 5947

add the following to your function.

closeOnEscape: false

Upvotes: 0

JF it
JF it

Reputation: 2403

You must use the closeOnEscape property, and set it to false,

Here is your new script:

$('#SubSkill').dialog({
      autoOpen: false,
      draggable: false,
      resizable: false,
      bgiframe: false,
      modal: true,
      width: dWidth,
      height: dHeight,
      title: "Enter Job Sub Skill Information",
      open: function (type, data) {
          $(this).parent().appendTo("form");
      },
      closeOnEscape: false 
  });

Upvotes: 0

Felix
Felix

Reputation: 38102

You can use closeOnEscape: false option:

$('#SubSkill').dialog({
    closeOnEscape: false,
    autoOpen: false,
    draggable: false,
    resizable: false,
    bgiframe: false,
    modal: true,
    width: dWidth,
    height: dHeight,
    title: "Enter Job Sub Skill Information",
    open: function (type, data) {
        $(this).parent().appendTo("form");
    }
});

References

Upvotes: 1

Related Questions