title: jQuery javascript not returning true/false properly
body: <p>I've written this code to show a prompt before a form is submitted. If the value of the form input is greater than 100, it shows a dialog informing the user roughly how long it'll take to process. If they click "OK", it should return true, and submit the form, if they click cancel, it should return false and not submit the form.</p>
  
  <p>The issue is, that the form isn't waiting for this response, it's submitting anyway. I can't figure out what's wrong...</p>
  
  <p>Here's the code:</p>
  
  <pre><code>$(document).ready(function() {
    $("form#generate_vouchers").submit(function(){
      if($("input#quantity").val() &gt; 100){
          var warning = "It will take around " + Math.round(($("input#quantity").val() / 23)) + " seconds to generate this batch.&lt;br /&gt;Generation will continue even if you leave this page.";
          //Does around 23 codes per second, nearly all of that time is inserts.
          $('&lt;div title="Batch information"&gt;&lt;/div&gt;').html(warning).dialog({
              draggable: false,
              modal: true,
              minWidth: 350,
              buttons: {
                  "Cancel" : function() {
                      $(this).dialog("close");
                      return false;
                  },
                  "Yes": function() {
                      $("input#submit").hide(300, function(){
                          $("img#loader").show(300);
                      });
                      return true;
                  }
              }
          });
      }
      else{
          $("input#submit").hide(300, function(){
              $("img#loader").show(300);
          });
      }
    });
   });
  </code></pre>