title: jquery.validate: Cannot read property 'nodeType' of null
body: <p>I've this little registration form</p>
  
  <pre><code>&lt;h2&gt;Please Register Your Account&lt;/h2&gt;
                  &lt;div class="form-horizontal" id="idFormRegistrazione"&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label id="labelUsername" for="idUsername" class="col-sm-2 col-xs-2 control-label"&gt;Username*&lt;/label&gt;
                          &lt;div class="col-sm-10 col-xs-10"&gt;
                              &lt;input type="text" class="form-control" id="idUsername" placeholder="Username" name="username"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label id="labelName" for="idName" class="col-sm-2 col-xs-2 control-label"&gt;Name&lt;/label&gt;
                          &lt;div class="col-sm-10 col-xs-10"&gt;
                              &lt;input type="text" class="form-control" id="idName" placeholder="Name" name="name"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label id="labelSurname" for="idSurname" class="col-sm-2 col-xs-2 control-label"&gt;Surname&lt;/label&gt;
                          &lt;div class="col-sm-10 col-xs-10"&gt;
                              &lt;input type="text" class="form-control" id="idSurname" placeholder="Surname" name="surname"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label id="labelEmail" for="idEmail" class="col-sm-2 col-xs-2 control-label"&gt;E-mail*&lt;/label&gt;
                          &lt;div class="col-sm-10 col-xs-10"&gt;
                              &lt;input type="text" class="form-control" id="idEmail" placeholder="Email" name="email"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label id="labelPassword" for="inputPassword" class="col-sm-2 col-xs-2 control-label"&gt;Password*&lt;/label&gt;
                          &lt;div class="col-sm-10 col-xs-10"&gt;
                              &lt;input type="password" class="form-control" id="inputPassword" placeholder="Password" name="password"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label id="labelPasswordConf" for="idPasswordConf" class="col-sm-2 col-xs-2 control-label"&gt;Repeat Password*&lt;/label&gt;
                          &lt;div class="col-sm-10 col-xs-10"&gt;
                              &lt;input type="password" class="form-control" id="idPasswordConf" placeholder="Repeat Password" name="passwordConf"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;p class="text-right" style="color: #E64040;"&gt;&lt;b&gt;* Campi Obbligatori&lt;/b&gt;&lt;/p&gt;
  
                      &lt;div id="idDivErrori"&gt;
                          &lt;div id="idErroriRegistrazione"&gt;
                              &lt;ul&gt;&lt;/ul&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;button id="idBtnRegister" class="btn btn-lg btn-primary btn-block" type="submit"&gt;Register Me&lt;/button&gt;
  </code></pre>
  
  <p>And this rules for the jquery.validate plugin</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(document).ready(function () {
  
              $('#idFormRegistrazione').validate({
                  onsubmit: false,
                  onfocusout: false,
                  onkeyup: false,
                  onclick: false,
                  errorContainer: "#idDivErrori",
                  errorLabelContainer: "#idDivErrori #idErroriRegistrazione ul",
                  wrapper: 'li',
                  ignore: '',
                  rules: {
                      username: {
                          required: true,
                      },
                      name: {
                          required: false,
                      },
                      surname: {
                          required: false,
                      },
                      email: {
                          required: true,
                          email: true,
                      },
                      password: {
                          required: true,
                      },
                      passwordConf: {
                          required: true,
                          equalTo: '#idPassword'
                      }
                  },
                  messages: {
                      username: {
                          required: 'Username is Required'
                      },
                      email: {
                          required: 'Email is Required',
                          email:  'Email format is not valid'
                      },
                      password: {
                          required: 'Password is required',
                      },
                      passwordConf: {
                          required: 'You have to Confirm your password',
                          equalTo: 'Confirm your Password Please'
                      }   
                  }
              });
          });
  
          function validateRegistration() {
              var is_valid_form = $('#idFormRegistrazione').validate().form();    
              if (is_valid_form) {            
                  return true;
              }
              else {
                  return false;
              }
          }
  &lt;/script&gt;
  </code></pre>
  
  <p>But when i'm call the function validateRegistration() i got the error:</p>
  
  <p>Cannot read property 'nodeType' of null </p>
  
  <p>Really i don't know why. Please Help me</p>