title: Using JQuery - preventing form from submitting
body: <p>How do I prevent a form from submitting using jquery?</p>
  
  <p>I tried everything - see 3 different options I tried below, but it all won't work: </p>
  
  <pre><code>    $(document).ready(function() { 
  
              //option A
              $("#form").submit(function(e){
                  e.preventDefault();
              });
  
              //option B
              $("#form").submit(function(e){
                  stopEvent(e);
              });
  
              //option C
              $("#form").submit(function(){
                  return false;
              });
      });
  </code></pre>
  
  <p>What could be wrong?</p>
  
  <p>Update - here is my html:</p>
  
  <pre><code>    &lt;form id="form" class="form" action="page2.php" method="post"&gt; 
         &lt;!-- tags in the form --&gt;
         &lt;p class="class2"&gt;
             &lt;input type="submit" value="Okay!" /&gt; 
         &lt;/p&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Is there anything wrong here?</p>