title: jQuery to submit a form
body: <p>I have the following code which is not working. I hope you can help me with this.</p>
  
  <p>basically I have a form that i want to confirm using jQuery Dialog first before submitting it. so when i click on submit i get the dialog but when i press yes to confirm nothing happens!!</p>
  
  <pre><code>    $(function() {
  
          $('#massform').submit(function(e){
             e.preventDefault();
             $('#dialog-mass-confirm').dialog('open');
          });
  
  
          $( "#dialog-mass-confirm" ).dialog({
              autoOpen: false,
              resizable: false,
              draggable: false,
              height:180,
              modal: true,
              buttons: {
                  "No": function() {
                      $( this ).dialog( "close" );
                  },
                  "Yes": function() {
                      $("#massform").submit();
                  }
              }
          });
      });
  
  &lt;form id="massform" method="post" action="new.php"&gt;
      &lt;input type="text" name="email" size="41"&gt;
      &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>