title: Supress submit event / Submit button enabled only if javascript is disabled
body: <p>I have some client-side JavaScript validation on a form. It works great. But I want to accommodate users who have JavaScript disabled. My validation isn't run from the form's onsubmit attribute, it's an event handler that is bound to a normal button in the form. So the button that kicks off the validation and submit isn't actually a submit, it's just type="button":</p>
  
  <pre><code>&lt;input type="button" value="Ok" class="okbtn"&gt;
  </code></pre>
  
  <p>Then I register an event handler to its click event that does my validation. It submits if everything passes:</p>
  
  <pre><code>function clickHandler(event){
      thisForm = event.data.caller
      var valid = submitValidation(thisForm);
      if (valid == true){
          thisForm.submit();
      } else{
        }
  }
  </code></pre>
  
  <p>My problem is if the user has JS disabled, there is no way to submit the form. I could make the button <code>type="submit"</code>, which would work for the JS-disabled users, but then it will *always submit the form and bypass the validation for the JS-enabled users. (The validation will run but it will submit anyway). If I make the button <code>type="submit"</code> can I block the submit event if it's clicked? I'm using JQuery, can JQuery suppress the submit? I want my validation to handle whether it gets submitted.</p>