title: Jquery: Form validation not working
body: <p>I am very new to Jquery and hope you guys can help me with this jquery validation problem.</p>
  
  <p>Been trying to validate the form but it does not validate at all. It accepts anything that I type in the field, regardless of what restrictions I set.</p>
  
  <p>Please help. Thank you.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/additional-methods.js"&gt;&lt;/script&gt;
      &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
      $(function(){
      $('#form').validate({
      alert("bbbb");
      rules: {
          name: {
              required: true,
              minlength: 2,
              maxlength: 20,
              lettersonly: true
          },
          ssn: {
              required: true,
              minlength: 9,
              maxlength: 9,
              nowhitespace: true
          },
          gender: {
              required: true
          },
          mobile: {
              required: true,
              minlength: 10,
              maxlength: 13,
              digits: true
          },
          address: {
              required: true,
              minlength: 10,
          },
          email: {
              required: true,
              minlength: 6,
              email: true
          }
      },
      messages: {
          name: {
              required: "Please enter your name",
              minlength: "Name should be more than 2 characters",
              maxlength: "Name should be less than 20 characters",
              lettersonly: "Name should contain only letters"
              },
          ssn: {
              required: "Please enter your NRIC",
              minlength: "NRIC should be more than 9 characters",
              maxlength: "NRIC should be less than 9 characters",
              nowhitespace: "NRIC should not have any spaces"
              },
          gender: {
              required: "Please select your gender",
              },
          mobile: {
              required: "Please enter your mobile number",
              minlength: "Mobile number should be more than 10 characters",
              maxlength: "Mobile number should be less than 13 characters",
              digits: "Mobile number should contain only digits"
              },
          address: {
              required: "Please enter your address",
              minlength: "Address should be more than 10 characters",
              },
          email: {
              required: "Please enter your email address",
              minlength: "Password should be more than 6 characters",
              email: "Please enter a valid email address"
              }
      },
      });
  
      $("#submit").click(function(){
          $("#form").submit();
          return false;
          });
  
      });
      &lt;/script&gt;
  
      &lt;div id="form"&gt;
      &lt;center&gt;
      &lt;form id="form"&gt;
      &lt;div class="col-xs-12"&gt;
      &lt;input type="text" name="name" id="name" placeholder="Name" required /&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-12"&gt;
      &lt;input type="text" name="nric" id="nric" placeholder="NRIC" required /&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-12"&gt;
      &lt;select class="dropdown" id="gender" onChange="changeColor(this)"&gt;
      &lt;option value="" disabled selected&gt;Gender&lt;/option&gt;
      &lt;option value="female"&gt;Female&lt;/option&gt;
      &lt;option value="male"&gt;Male&lt;/option&gt;
      &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-12"&gt;
      &lt;input type="text" name="mobile" id="mobile" placeholder="Mobile" required /&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-12"&gt;
      &lt;input type="text" name="address" id="address" placeholder="Address" required /&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-12"&gt;
      &lt;input type="email" name="email" id="email" placeholder="Email" required /&gt;
      &lt;/div&gt;
      &lt;input id="submit" class="button" type="submit" value="submit"/&gt;
      &lt;/form&gt;
  &lt;/center&gt;
  &lt;/div&gt;
  </code></pre>