title: jQuery validation - element is undefined
body: <p>I am using a jquery.validation plugin to validate my inputs on the form</p>
  
  <p>I use it as follows:</p>
  
  <pre><code>$(document).ready(function () {
  jQuery(function () {
      // You can specify some validation options here but not rules and messages
  
      jQuery('form[id="reservationForm"]').validate({ ignore: ":not(:visible)" });
  
      $("#adult1Birthdate").mask("9999-99-99");
      $("#reservationPersonBirthdate").mask("9999-99-99");
  
      $("#adult1Firstname").rules("add", { required: true, minlength: 2, messages: { required: '&lt;span style="color:Red"&gt;Pole wymagane&lt;/span&gt;'} });
  });
  </code></pre>
  
  <p>});</p>
  
  <p>I get the following error however:</p>
  
  <blockquote>
    <p>element is undefined</p>
  </blockquote>
  
  <p>in the following line:</p>
  
  <pre><code>var settings = $.data(element.form, 'validator').settings;
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>**EDIT**
  </code></pre>
  
  <p>Also the following code does not work when I use jquery.validation</p>
  
  <pre><code>    $(document).ready(function () {
  $(function () {
  
                  $('a[id^="regionDetails"]').click(function () {
                      var vid_id = $(this).attr("id").replace("regionDetails", "#regionDetailsArea");
                      $('div[id^="regionDetailsArea"]').hide();
                      $(vid_id).show();
                      return false;
                  });
              });
  });
  </code></pre>