New to Kendo UI for jQuery? Download free 30-day trial

Close Dialog on Pressing Enter


Product Progress® Kendo UI® Dialog for jQuery
Operating System All
Browser All
Preferred Language JavaScript


How can I close a Kendo UI Dialog by pressing the Enter key?


  1. If the Dialog is open, in the handler check attach a keypress handler to the document.
  2. Call its close method.
    <div id='dialog'>My Kendo Dialog</div>
      $(document).ready(function (e) {

      $(document).keypress(function (e) {
        if (e.which == 13) {
          if ($(".k-dialog").css("display") == "flex") {
In this article