0

How do I close any open jquery-ui dialog if any input change is being made in the page outside the open dialog?

I wrote this code:

$("input").keyup(function () { 
     $(".ui-dialog-content").dialog("close");
});

That works fine, but that closes the dialog even if a input change is being made withing the dialog, I only need to close the dialog if an input change is being made in the page, outside the dialog.

Please advise.

user3378165
  • 6,546
  • 17
  • 62
  • 101
  • Possible duplicate of [jQuery UI - Close Dialog When Clicked Outside](http://stackoverflow.com/questions/2554779/jquery-ui-close-dialog-when-clicked-outside) – Sudharsan S Oct 28 '16 at 06:12
  • And refer http://stackoverflow.com/questions/8306547/jquery-ui-dialogs-how-to-close-dialog-when-click-outside – Sudharsan S Oct 28 '16 at 06:13

1 Answers1

0

That close any open jquery dialog on any input change on the page.

  $('.ui-widget-overlay').live("click", function () {
    $("#dialog").dialog("close");
  });
user3378165
  • 6,546
  • 17
  • 62
  • 101