title: jquery datepicker: defining mindate and maxdate from dropdown
body: <p>I have this code and it's working fine. The <code>mindate</code> and <code>maxdate</code> are defined dynamically where the selected date from the dropdown will be the <code>maxdate</code> and the <code>mindate</code> will be 14 days before the <code>maxdate</code>. But when I go back to the dropdown and re-select a second time, the <code>mindate</code> and <code>maxdate</code> is locked from the first selection from the dropdown.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;select id="dropdown" name="dropdown"&gt;
      &lt;option value="12/08/2012"&gt;
      &lt;option value="12/22/2012"&gt;
      &lt;option value="01/05/2013"&gt;
  &lt;/select&gt;
  
  &lt;input type="text" id="start_date" name="xdate"&gt;
  
  &lt;script&gt;
      $(function () {
          $('select[name="dropdown"]').change(function () {
              var bits = $(this).val().split('/');
              var end = new Date(bits[2], bits[0] - 1, bits[1]);
              var start = new Date(end.getTime());
              start.setDate(start.getDate() - 13);
              $('#start_date').multiDatesPicker({minDate:start, maxDate:end});
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>How can the <code>mindate</code> and <code>maxdate</code> change dynamically after selecting another range the second time? Am I missing something? Thanks! :)</p>