title: Jquery / Javascript - Add years to date variable
body: <p>I have a small trouble that would be great to have some help with. I am creating a small form that I want to take a current date formatted <code>'dd/mm/yyyy'</code> and add a year(s) variable from a drop-down box to create a final expiry date. The only trouble is that I do not know how to parse the start-date as a date variable in order to complete the calculation. Any thoughts or help would be greatly appreciated. Paul. </p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          $("#registerfor, #startdate, ").change(function () {
              // Get Variables
              var startdate = $("#startdate").val();
              var registerfor = $("#registerfor").val();
              // Add Years to Date
              var expirydate = startdate + registerfor;
              // Send Result on
              $("#expires").val(expirydate);
          });
      });
  &lt;/script&gt;
  &lt;input name="startdate" id="startdate" value="dd/mm/yyyy" /&gt;
  &lt;select id="registerfor" name="registerfor"&gt;
      &lt;option value="1"&gt;1 Year&lt;/option&gt;
      &lt;option value="2"&gt;2 Years&lt;/option&gt;
      &lt;option value="3"&gt;3 Years&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>