title: jquery.validate.js expiration date how to use this validator add method
body: <p>I have a Credit Card processing form with 2 select fields for the expiration date. Like this</p>
  
  <pre><code>&lt;select name="qbms_cc_expires_month" id="qbms_cc_expires_month"&gt;&lt;option value="01"&gt;01&lt;/option&gt;&lt;option value="02"&gt;02&lt;/option&gt;&lt;option value="03"&gt;03&lt;/option&gt;&lt;option value="04"&gt;04&lt;/option&gt;&lt;option value="05"&gt;05&lt;/option&gt;&lt;option value="06"&gt;06&lt;/option&gt;&lt;option value="07"&gt;07&lt;/option&gt;&lt;option value="08"&gt;08&lt;/option&gt;&lt;option value="09"&gt;09&lt;/option&gt;&lt;option value="10"&gt;10&lt;/option&gt;&lt;option value="11"&gt;11&lt;/option&gt;&lt;option value="12"&gt;12&lt;/option&gt;&lt;/select&gt;&lt;span class="required"&gt;*&lt;/span&gt;&amp;nbsp;&lt;select name="qbms_cc_expires_year" id="qbms_cc_expires_year"&gt;&lt;option value="12"&gt;2012&lt;/option&gt;&lt;option value="13"&gt;2013&lt;/option&gt;&lt;option value="14"&gt;2014&lt;/option&gt;&lt;option value="15"&gt;2015&lt;/option&gt;&lt;option value="16"&gt;2016&lt;/option&gt;&lt;option value="17"&gt;2017&lt;/option&gt;&lt;option value="18"&gt;2018&lt;/option&gt;&lt;option value="19"&gt;2019&lt;/option&gt;&lt;option value="20"&gt;2020&lt;/option&gt;&lt;option value="21"&gt;2021&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>I have added this $.validator.addMethod</p>
  
  <pre><code>    $.validator.addMethod(
          "ccexpdate",
      function (value, element) {
  
          // Initialize todays date   i.e start date
          var today = new Date();
          var startDate = new Date(today.getFullYear(),today.getMonth(),1,0,0,0,0);
  
          // Initialize End/Expiry date i.e. adding 10 years to expire
          var futureLimitDate= new Date(today.getFullYear()+10,today.getMonth(),1,0,0,0,0);
          var expDate = value;
  
          var expYearCheck='';
  
          // Check Date format
          var separatorIndex = expDate.indexOf('/');
          if(separatorIndex==-1)return false; // Return false if no / found
  
          var expDateArr=expDate.split('/'); 
          if(expDateArr.length&gt;2)return false; // Return false if no num/num format found
  
          // Check Month for validity
          if(eval(expDateArr[0])&lt;1||eval(expDateArr[0])&gt;12)
          {
              //If month is not valid i.e not in range 1-12
              return false;
          }
  
          //Check Year for format YY or YYYY
          switch(expDateArr[1].length)
          {
              case 2:expYearCheck=2000+parseInt(expDateArr[1], 10);break; // If YY format convert it to 20YY to it
              case 4:expYearCheck=expDateArr[1];break; // If YYYY format assign it to check Year Var
              default:return false;break;
          }
  
  
          // Calculated new exp Date for ja  
          expDate=new Date(eval(expYearCheck),(eval(expDateArr[0])-1),1,0,0,0,0);
  
  
  
          if(Date.parse(startDate) &lt;= Date.parse(expDate))
          {
              if(Date.parse(expDate) &lt;= Date.parse(futureLimitDate))
              {
                  // Date validated
                  return true;    
              }else
              {
  
                  // Date exceeds future date
                  return false;
              }
  
          }else
          {
  
              // Date is earlier than todays date
              return false;
          }
  
  
      },
      "&lt;br /&gt;Must be a valid Expiration Date."
      );
  </code></pre>
  
  <p>How do I call this in my rules: { } section?
  I tried this
                  qbms_cc_expires_year: {
                  ccexpdate: {
                        month: '#qbms_cc_expires_month',
                        year: '#qbms_cc_expires_year'
                  }
            },
  But it doesn't work.</p>