title: jquery form submit with confirmation in a modal
body: <p>I've used some code from another question asked years ago
  <a href="https://stackoverflow.com/questions/17037634/implement-jquery-confirmation-modal-in-a-form-submit/17037698#17037698">Implement jQuery confirmation modal in a form submit?</a></p>
  
  <p>but that question didn't go far enough to show how a form could be submitted when responding with Yes and I haven't been able to get this to work.</p>
  
  <p>You will see all the ways I've tried to make work (they are commented out).
  Does anybody know what I'm doing wrong here?</p>
  
  <pre><code>     &lt;div id="dialog-confirm" title="Ready?"&gt;
           &lt;p&gt;Are you sure?&lt;/p&gt;
       &lt;/div&gt;
  
      &lt;form action"" id="myform" name="myform2" type="post"&gt;
          &lt;input type="submit" value="Yes" name="moveOn" /&gt;
      &lt;/form&gt;
  
       &lt;script&gt;
        $(function() {
          $("#dialog-confirm").dialog({
           resizable: false,
           height:190,
           autoOpen: false,
           width: 330,
           modal: true,
           buttons: {
             "Yes": function() {
               //$('#myform')[0].submit();
               //document.myform2.submit();
               //document.getElementById("#myform").submit();
  
                },
          No: function() {
             $(this).dialog("close");
           }
       }
  
     });
  
      $('#myform').submit(function() {
         $("#dialog-confirm").dialog('open');
         return false;
         });
  
         });
  </code></pre>