title: jQuery validate, validation not working
body: <p>I have got a simple signup form that uses jQuery validate to validate the contents of the form. but it doesnt seem to be working. My servlet fires and the form is submitted with invalid data regardless of the jQuery at the top of my page. Below is my code. Can anyone please help?</p>
  
  <p>Script code:</p>
  
  <pre><code>&lt;head&gt;
      &lt;title&gt;Sign Up&lt;/title&gt;
      &lt;meta charset="iso-8859-1"&gt;
      &lt;link rel="stylesheet" href="style/style.css" type="text/css"&gt;
      &lt;!--[if lt IE 9]&gt;&lt;script src="scripts/html5shiv.js"&gt;&lt;/script&gt;&lt;![endif]--&gt;
      &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.js" type="text/javascript"&gt;
      &lt;/script&gt;
      &lt;script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"&gt;
      &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $().ready(function() {
              // validate the comment form when it is submitted
              $("#signup").validate();
  
              // validate signup form on keyup and submit
              $("#signup").validate({
                  rules: {
                      firstname: "required",
                      lastname: "required",
                      address1: "required",
                      city: "required",
                      county: "required",
                      postcode: "required",
  
                      password_s: {
                          required: true,
                          minlength: 5
                      },
                      password_s_con: {
                          required: true,
                          minlength: 5,
                          equalTo: "#password_s"
                      },
                      email: {
                          required: true,
                          email: true
                      },
  
                      agree: "required"
                  },
                  messages: {
                      firstname: "Please enter your first name",
                      lastname: "Please enter your last name",
                      address1: "Please enter your addres",
                      city: "Please enter your city/town",
                      county: "Please enter your county",
                      postcode: "Please enter your postcode",
  
                      password: {
                          required: "Please provide a password",
                          minlength: "Your password must be at least 5 characters long"
                      },
                      confirm_password: {
                          required: "Please provide a password",
                          minlength: "Your password must be at least 5 characters long",
                          equalTo: "Please enter the same password as above"
                      },
                      email: "Please enter a valid email address",
                      agree: "Please accept our policy"
                  }
              });
  
          });
      &lt;/script&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>The Form:</p>
  
  <pre><code>&lt;table align="left"&gt;
  &lt;tr&gt;&lt;td align="left"&gt;
          &lt;form name="signup" id="signup" action="SignUpServlet" method="post"&gt;
              &lt;table width="400px" align="right" class=""&gt;
                  &lt;fieldset&gt;
                      &lt;legend&gt;Sign Up:&lt;/legend&gt;
                      &lt;tr&gt;
                          &lt;td&gt;First Name:&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="firstname" name="firstname" required="required"&gt;*&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Last Name:&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="lastname" name="lastname" required="required"&gt;*&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Address Line 1:&lt;/td&gt;&lt;td&gt; &lt;input type="text" id="address1" name="address1" required="required"&gt;*&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Address Line 2:&lt;/td&gt;&lt;td&gt; &lt;input type="text" id="address2" name="address2"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;City:&lt;/td&gt;&lt;td&gt; &lt;input type="text" id="city" name="city" required="required"&gt;*&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;County:&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="county" name="county" required="required"&gt;*&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Postcode:&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="postcode" name="postcode" required="required"&gt;*&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Phone:&lt;/td&gt;&lt;td&gt; &lt;input type="text" id="phone" name="phone"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Email Address:&lt;/td&gt;&lt;td&gt; &lt;input type="text" id="email_s" name="email_s" required="required"&gt;*&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Password:&lt;/td&gt;&lt;td&gt; &lt;input type="password" id="password_s" name="password_s" required="required"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Confirm Password:&lt;/td&gt;&lt;td&gt; &lt;input type="password" id="password_s_con" name="password_s_con" required="required"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;Privacy Policy:&lt;/td&gt;&lt;td&gt; &lt;input type="checkbox" class="checkbox" id="agree" name="agree" required="required"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;/td&gt;&lt;td&gt;
                              &lt;input type="submit" id="lf_submit" value="submit"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/fieldset&gt;
              &lt;/table&gt;
          &lt;/form&gt;
      &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td align="left"&gt; &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>