title: Prevent submission of form until specified button clicked (thickbox dialog)
body: <p>I would like to make a modal confirmation window using jQuery &amp; thickbox  on every form with 'confirm' class.</p>
  
  <p><strong>Here's the HTML markup:</strong></p>
  
  <pre><code>&lt;!-- The form below --&gt;
  &lt;form id="myform" class="confirm" name="actionform" action="target.php"&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;input type="text" value="" placeholder="id" name="id" id="id"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" value="" placeholder="title" name="title" id="title"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="submit" value="Form elküldése"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  
  &lt;!-- The modal box and it's content below, called with tb_show() function --&gt;
  &lt;div id="myModalConfirm" style="display:none"&gt;
      &lt;div&gt;
          &lt;p&gt;Are you sure?&lt;/p&gt;
          &lt;button id="yes"&gt;Yes, I'm sure&lt;/button&gt;&lt;button id="cancel"&gt;No, cancel it&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>So the problem:</strong></p>
  
  <p>The modal dialog show up and works fine and the cancel button works but clicking on button#yes won't submit the form and I think it's because of the preventDefault() function.</p>
  
  <p><strong>Here's the jQuery (I'm working from jquery.1.8.3 lib, so please care about the compatibility )</strong></p>
  
  <pre><code>$(document).ready(function(){
      $('form.confirm').submit(function(e){
          var form = $(this);
          e.preventDefault();
          tb_show("Megerősítés","#TB_inline?height=100&amp;amp;width=200&amp;amp;inlineId=myModalConfirm&amp;amp;modal=true",null);
          $('button#yes').click(function(){
              $(form).submit;
  
  
              });
          $('button#cancel').click(function(){
              tb_remove();
              return false;
              });
      })
  
  });
  </code></pre>
  
  <p><strong>======| The solution |==============================================================</strong>
  <em>It's for me but checkout the other goods below in comments :)</em></p>
  
  <pre><code>$('form.confirm').submit(function(e, submit){
          if (!submit) e.preventDefault();
          tb_show("Megerősítés","#TB_inline?height=100&amp;amp;width=200&amp;amp;inlineId=myModalConfirm&amp;amp;modal=true",null);
      })
  
      $('#yes').click(function(){
          $('form.confirm').trigger('submit', [true]);
      });
  
  
      $('#cancel').click(function(){
          tb_remove();
      });
  </code></pre>