title: Modal dialog closing immediately
body: <p>I'm having a problem with the modal dialog, it activates when the user push and input button, then the modal dialog shows, and disappears immediately without do it anything.</p>
  
  <p>The code:</p>
  
  <pre><code>$('form').submit(function(e) {
      var dialog = $("#dialog");
      if ($("#dialog").length == 0) {
          dialog = $('&lt;div id="dialog" style="display:hidden"&gt; Los datos ingresados son:&lt;/div&gt;').appendTo('body');
      }
      dialog.load(
          $("#dialog").dialog({
              close: function(event, ui) {
                  dialog.remove();
              },
              resizable: false,
              //height: 140,
              //width: 460
              modal: true,
              buttons: {
                  "Ok": function() {
                      $(this).dialog("close");
                  },
                  Cancel: function() {
                      $(this).dialog("close");
                  }
              }
          })
      );
      return true;
  });
  </code></pre>
  
  <p>Besides, how can I make that, when the user push ok in the modal dialog, the event continues?</p>