title: how to use jquery UI dialog as javascript confirm?
body: <p>I read lots of questions about this, but every solution uses the same workaround, submiting the form inside the jquery dialog, something like this:</p>
  
  <pre><code> $("#dialog").dialog({
    buttons : {
      "Confirm" : function() {
        window.location.href = targetUrl;
      },
      "Cancel" : function() {
        $(this).dialog("close");
      }
    }
  </code></pre>
  
  <p>Isn't there an easier way, more like javascript confirm?</p>
  
  <pre><code>&lt;input type="submit" onclick="return confirm('are you sure?');" /&gt;
  </code></pre>
  
  <p>Why something like return true, return false doesn't work?</p>