title: jQuery Validation equalTo not working comparing two email addresses
body: <p>I have my form and validation code below. Everything else is working but compare two email address does not work. It gives me </p>
  
  <p>Uncaught TypeError: Cannot read property 'call' of undefined </p>
  
  <p>HTMLcode and script below. I am using bootstrap 3.</p>
  
  <pre><code>        &lt;form class="form-horizontal" id="form" &gt;
            &lt;fieldset&gt;
            &lt;legend&gt; Dealer Registration &lt;/legend&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="dealer_name" class="col-sm-2 control-label"&gt;Dealership Name&lt;/label&gt;
              &lt;div class="col-sm-6"&gt;
                &lt;input type="text" class="form-control" id="dealer_name" name="dealer_name"  placeholder="Dealership Name"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="street" class="col-sm-2 control-label"&gt;Address&lt;/label&gt;
              &lt;div class="col-sm-3"&gt;
                &lt;input type="text" class="form-control" id="street" name="street" placeholder="Street number and Name"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="suburb" class="col-sm-2 control-label"&gt;&lt;/label&gt;
              &lt;div class="col-sm-3"&gt;
                &lt;input type="text" class="form-control" id="suburb" name="suburb" placeholder="Suburb"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="state" class="col-sm-2 control-label"&gt;&lt;/label&gt;
              &lt;div class="col-sm-3"&gt;
                &lt;input type="text" class="form-control" id="state" name="state" placeholder="State"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="postcode" class="col-sm-2 control-label"&gt;&lt;/label&gt;
              &lt;div class="col-sm-2"&gt;
                &lt;input type="text" class="form-control" id="postcode" name="postcode" placeholder="Post Code"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="email1" class="col-sm-2 control-label"&gt;Email&lt;/label&gt;
              &lt;div class="col-sm-4"&gt;
                &lt;input type="email" class="form-control" id="email1" name="email1" placeholder="Email"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="email2" class="col-sm-2 control-label"&gt;Confirm Email&lt;/label&gt;
              &lt;div class="col-sm-4"&gt;
                &lt;input type="email" class="form-control" id="email2" name="email2" placeholder="Email"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="first_name" class="col-sm-2 control-label"&gt;Contact&lt;/label&gt;
              &lt;div class="col-sm-4"&gt;
                &lt;input type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="last_name" class="col-sm-2 control-label"&gt;&lt;/label&gt;
              &lt;div class="col-sm-4"&gt;
                &lt;input type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;div class="col-sm-offset-2 col-sm-6"&gt;
                &lt;div class="checkbox"&gt;
                  &lt;label&gt;
                    &lt;input type="checkbox"&gt; Agree the terms and conditions (to do)
                  &lt;/label&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;div class="col-sm-offset-2 col-sm-6"&gt;
                &lt;button type="submit" class="btn btn-default"&gt;Sign in&lt;/button&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;/fieldset&gt;
          &lt;/form&gt;
  
  
  
          &lt;script&gt;
  $(document).ready(function(){
      $("form").validate({
          rules: {
              dealer_name:{
                  minlength: 3,
                  maxlength: 50,
                  required: true
              },
              street:{
                  minlength: 3,
                  required: true
              },
              suburb:{
                  minlength: 3,
                  required: true
              },
              state:{
                  minlength: 1,
                  required: true
              },
               postcode:{
                  minlength: 4,
                  maxlength: 4,
                  required: true
              },          
              email1:{
                  minlength: 1,
                  required: true,
              },
              email2:{
                  minlength: 1,
                  required: true,
                  email1: {
                       equalTo: '#email2'
                  }
              },
              state:{
                  minlength: 1,
                  required: true
              },
              first_name:{
                  minlength: 1,
                  required: true
              },
              last_name:{
                  minlength: 1,
                  required: true
              }           
          },
          highlight: function (element) {
              $(element).closest('.form-group').removeClass('has-success').addClass('has-error');
          },
          unhighlight: function (element) {
              $(element).closest('.form-group').removeClass('has-error').addClass('has-success');
          }
      });
  }); 
  &lt;/script&gt;
  </code></pre>
  
  <p>Can someone help ? </p>