title: how to submit form only if validation is success
body: <p>i try to validate the form before submitting the request.
  i am using jquery validation</p>
  
  <p>i am expecting when page finish load, the form will auto submit, and i will see "Loading" in the div.
  but nothing happen
  here is my code. but seems it is not working.. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      function submitForm() {
          $('#SearchForm').validate({
              errorLabelContainer: "#ErrorLabel",
              rules: {
                  instrument: {
                      required: true,
                      maxlength: 10
                  }
              },
              messages: {
                  maxlength: "Must no longer than 10 characters",
                  required: "Must not be empty"
              },
  
              submitHandler: function () { $('#SearchForm').submit(); }
          });
      }
  
      $(document).ready(function () {
          $('#SearchForm').submit(function () {
              $('#DivToUpdate').text('Loading ...');
          });
          submitForm();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>ll</p>