title: jQuery datepicker - defaultDate (dynamically) from another datepicker
body: <p>I have two datepickers at the moment, one for a start date, and another for an end date.</p>
  
  <p>When you select the first date, I'd like the default value of the second datepicker to be set to the same date. If I use the <code>setDate</code> it works and sets the value just fine, but the default value won't change - if I set the <code>defaultDate</code> when the datepicker is loaded, it works, but if I try to set it on the fly it doesn't.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>if($('#startDate').val().length == 10 &amp;&amp; $("#endDate").val().length != 10) {
      $("#endDate").datepicker("defaultDate", $("#startDate").datepicker("getDate"));
  }
  </code></pre>
  
  <p>(edit) for clarification, I don't want to set the date - the user needs to do that, but I'd like the datepicker to go straight to the same date as the start date, to save them having to trawl through numerous pages.</p>
  
  <p>Here's the (kinda) working code: <a href="http://jsfiddle.net/c8H5y/" rel="nofollow">http://jsfiddle.net/c8H5y/</a></p>
  
  <p>Any suggestions would be very welcome, thank you!</p>