title: jquery dialog: confirm the click on a submit button
body: <p>I'm trying to do a confirm dialog using jquery, but the form doesn't get submitted at all, this is what I got:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
      var currentForm;
      $(function() {
          $("#dialog-confirm").dialog({
              resizable: false,
              height: 140,
              modal: true,
              autoOpen: false,
              buttons: {
                  'Delete all items': function() {
                      currentForm.submit();
                      $(this).dialog('close');
                  },
                  Cancel: function() {
                      $(this).dialog('close');
                  }
              }
          });
      });
  
      function ask() {
          currentForm = $(this).closest('form');
          $("#dialog-confirm").dialog('open');
      }
  &lt;/script&gt;
  &lt;form ... &gt;
      &lt;input type="submit" value="delete" onclick="ask();return false;" /&gt;
  &lt;/form&gt;
  </code></pre>