title: jquery Datepicker - fill input fields on page load
body: <p>I have the following three input boxes, in an ASP Classic page, each associated with a corresponding jquery datepicker calendar:</p>
  
  <pre><code>&lt;br /&gt;
  Start Date: &lt;input type="text" id="dtpDateStart" name="dtpDateStart" /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  End Date:   &lt;input type="text" id="dtpDateEnd" name="dtpDateEnd" /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  Return By:  &lt;input type="text" id="dtpDateReturn" name="dtpDateReturn" /&gt;
  &lt;br /&gt;
  </code></pre>
  
  <p>And the JQuery script:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function () {
      $("#dtpDateStart").datepicker({
          beforeShowDay: $.datepicker.noWeekends,
          changeMonth: true,
          changeYear: true,
          dateFormat: 'm/d/yy',
          onClose: function (selectedDate) {
              $("#dtpDateEnd").datepicker("option", "minDate", selectedDate);
          }
      });
      $("#dtpDateEnd").datepicker({
          beforeShowDay: $.datepicker.noWeekends,
          changeMonth: true,
          changeYear: true,
          dateFormat: 'm/d/yy',
          onClose: function (selectedDate) {
              $("#dtpDateStart").datepicker("option", "maxDate", selectedDate);
              $("#dtpDateReturn").datepicker("option", "minDate", selectedDate);
          }
      });
      $("#dtpDateReturn").datepicker({
          beforeShowDay: $.datepicker.noWeekends,
          changeMonth: true,
          changeYear: true,
          dateFormat: 'm/d/yy',
          onClose: function (selectedDate) {
              $("#dtpDateEnd").datepicker("option", "maxDate", selectedDate);
          }
      });
  
  });
  </code></pre>
  
  <p></p>
  
  <p>When a date is chosen in the Start Date calendar (dtpDateStart), the End Date (dtpDateEnd) calendar will only allow for a date after the start date to display.  And so on with the return date calendar (dtpDateReturn).</p>
  
  <p>But I now need to add a two more items of functionally:</p>
  
  <ol>
  <li><p>On page load, fill todays date into the Start and End input fields and tomorrows date into the ReturnBy input field.</p></li>
  <li><p>if the StartDate is changed, automatically update the EndDate and ReturnByDate fields to the same date (or +1), if the dates already in them are before the StartDate (otherwise leave them if they are after the StartDate) </p></li>
  </ol>
  
  <p>I have the first item working elsewhere in a simple calendar with the following: </p>
  
  <pre><code>$("#jqDatePicker").datepicker("setDate", new Date);
  </code></pre>
  
  <p>but can't seem to roll it into the above function.</p>
  
  <p>Any suggestions?</p>