title: Jquery datepicker make only 1 day selectable and copy date +x days in next input
body: <p>I am trying to make the Jquery-UI datepicker have only 1 date available per month, which is the 1st of every month, when selected the selected date + X days, should be copied into another text input field.</p>
  
  <p>Additionally, the value of days to be added changes with what has been selected in the dropdown.</p>
  
  <p>Fiddle what I have so far:
  <a href="http://jsfiddle.net/8y4Bf/">http://jsfiddle.net/8y4Bf/</a></p>
  
  <p>Code from fiddle:</p>
  
  <p>Html</p>
  
  <pre><code>&lt;div&gt;
      &lt;label&gt;Select an Option:&lt;/label&gt;
      &lt;select id="select1"&gt;
          &lt;option value="" disabled="disabled" selected="selected"&gt;Select an option&lt;/option&gt;
          &lt;option value="1"&gt;Option 1&lt;/option&gt;
          &lt;option value="2"&gt;Option 2&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;br /&gt;&lt;br /&gt;
  &lt;div&gt;
      &lt;label&gt;Start Date:&lt;/label&gt;
      &lt;input type="text" id="startdate" /&gt;
      &lt;br /&gt;&lt;br /&gt;
      &lt;label&gt;End Date:&lt;/label&gt;
      &lt;input type="text" id="enddate" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Jquery</p>
  
  <pre><code>$('#select1').change(function() {
  
  
      $('#startdate, #enddate').val("");
  
  
      if ($('#select1').val() == '1') {
  
  
          $('#startdate').datepicker({
              showButtonPanel: true,
              closeText: 'Close',
              dateFormat: "mm/dd/yy",
              onSelect: function(selected) {
                  if (this.id == 'startdate') {
  
                      // Parameters 1 day only &amp; also copy result into enddate + 5 days
                  }
              }
          });
      }
  
       else if ($('#select1').val() == '2') {
  
  
          $('#startdate').datepicker({
              showButtonPanel: true,
              closeText: 'Close',
              dateFormat: "mm/dd/yy",
              onSelect: function(selected) {
                  if (this.id == 'startdate') {
  
                     // Parameters 1 day only &amp; also copy result into enddate + 7 days
                  }
              }
  
              });
  
       }
  
  });
  </code></pre>
  
  <p>I have read the documentation at <a href="http://jqueryui.com/datepicker/#min-max">http://jqueryui.com/datepicker/#min-max</a> but can't figure out how do I make only the 1st of every month available.</p>
  
  <p>And do I have to fetch the value of <code>#startdate</code> again, add the days and then paste it into <code>#enddate</code> or is that value saved somewhere so I can go from there ?</p>