title: Prevent form submit if field value is false
body: <p>I am trying to create some code to use jQuery to prevents the users from submitting a form if the value in a text field is different from 50. The form submit work great, but I am having some issues with the jQuery code to prevent submitting.</p>
  
  <p>My HTML Code:</p>
  
  <pre><code>&lt;form name="vehicleRegFrm" id="vehicleRegFrm" action="" method="post"&gt;
      &lt;input name="samp" id="samp" type="text" /&gt;
      &lt;input name="sbtAddCarFrm" type="submit" value="Continue" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is the problematic jQuery code:</p>
  
  <pre><code>$('sbtAddCarFrm').on('click', function(event) {
      event.preventDefault ? event.preventDefault() : event.returnValue = false;
  
      if ($('samp').val() != 50) {
          $('vehicleRegFrm').submit();
      } else {
          alert("your message");
      }
  });
  </code></pre>