ฉันไม่รู้ว่ามีตัวเลือกในวิดเจ็ต jQuery UIหรือไม่ แต่คุณสามารถผูกkeypressเหตุการณ์กับ div ที่มีไดอะล็อกของคุณได้ ...
$('#DialogTag').keypress(function(e) {
    if (e.keyCode == $.ui.keyCode.ENTER) {
          //Close dialog and/or submit here...
    }
});
สิ่งนี้จะทำงานไม่ว่าองค์ประกอบใดจะมีโฟกัสในกล่องโต้ตอบของคุณซึ่งอาจเป็นหรือไม่ใช่สิ่งที่ดีขึ้นอยู่กับสิ่งที่คุณต้องการ
หากคุณต้องการให้ฟังก์ชันนี้เป็นฟังก์ชันเริ่มต้นคุณสามารถเพิ่มโค้ดส่วนนี้ได้:
// jqueryui defaults
$.extend($.ui.dialog.prototype.options, { 
    create: function() {
        var $this = $(this);
        // focus first button and bind enter to it
        $this.parent().find('.ui-dialog-buttonpane button:first').focus();
        $this.keypress(function(e) {
            if( e.keyCode == $.ui.keyCode.ENTER ) {
                $this.parent().find('.ui-dialog-buttonpane button:first').click();
                return false;
            }
        });
    } 
});
นี่คือมุมมองโดยละเอียดเพิ่มเติมว่าจะมีลักษณะอย่างไร:
$( "#dialog-form" ).dialog({
  buttons: { … },
  open: function() {
    $("#dialog-form").keypress(function(e) {
      if (e.keyCode == $.ui.keyCode.ENTER) {
        $(this).parent().find("button:eq(0)").trigger("click");
      }
    });
  };
});