title: Credit Card Date Validation MM/YYYY Format
body: <p>I need help with a piece of JavaScript, I am trying to make a date validation script which won't allow anything past a certain date, here is what I have so far;</p>
  
  <p>This is where a customer can choose what date their Credit Card expires</p>
  
  <pre><code>Expiry MM/YYYY
  &lt;select id="expiry" name='expiry'&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;select id="expiry" name='expiry'&gt;
  &lt;option value="2016"&gt;2016&lt;/option&gt;
  &lt;option value="2017"&gt;2017&lt;/option&gt;
  &lt;option value="2018"&gt;2018&lt;/option&gt;
  &lt;option value="2019"&gt;2019&lt;/option&gt;
  &lt;option value="2020"&gt;2020&lt;/option&gt;
  &lt;option value="2021"&gt;2021&lt;/option&gt;
  &lt;option value="2022"&gt;2022&lt;/option&gt;
  &lt;/p&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>and here is my if/else statement to let it past or block it</p>
  
  <pre><code>function validateForm()
  {
  var currentDate = new Date();
  var month = currentDate.getMonth(5)+1;
  var year = currentDate.getFullYear(2016);
  if (expiry &lt; currentDate)
  {
      alert("The date is not valid");
      expiry.focus();
      return false;
  }
  
  alert("Thank you for your order");
  return true;
  }
  </code></pre>
  
  <p>Currently it is letting it past even if the date is past today's date, if you can help, thank you.</p>
  
  <p>Much obliged</p>
  
  <p>-Traigh Warren</p>