title: Stop form submitting in jquery if an error
body: <p>This is my code: <a href="http://jsfiddle.net/Xk38X/6/" rel="nofollow">http://jsfiddle.net/Xk38X/6/</a></p>
  
  <pre><code>  $('#register').click(function()
  {
      if( $('#company_f').val().length == 0 ) {
          $('#company_f').css("border", "solid 1px red");
      }
  });
  </code></pre>
  
  <p>The issue is even when it errors it still sends the form. Can anyone please tell me how I stop it submitting the form if the user hits the button and the company field isn't filled out.</p>
  
  <p>Thank you.</p>