title: Jquery stop form submission on same page
body: <p>I have a form within a php page. And I want to stop it's submission with jquery for validation purposes.</p>
  
  <pre><code>$('form').submit(function(){
          alert('submitting');
          return false;
      });
  </code></pre>
  
  <p>Now this works just fine, if I try to send the form to another page. But if I write the php side validation and insertion codes on the same page as the form (with form's <code>action=""</code>), the page refreshes on submit and the data gets inserted in db.....any way to stop this? or do I have to use two separate pages for form and serverside validation/insertion ?</p>