title: Retain previously selected value in jquery-ui datepicker
body: <p>I have a datepicker which is displayed on a custom button click event. The user selected date is then populated in a textbox. By default, the datepicker selects a past date (-3 days).</p>
  
  <p><strong>Issue:</strong></p>
  
  <p>The issue I am facing is, the previously selected date is not retained on the textbox upon subsequent custom button clicks.</p>
  
  <p><strong>Fiddler:</strong></p>
  
  <p><a href="https://jsfiddle.net/99x50s2s/142/" rel="nofollow">https://jsfiddle.net/99x50s2s/142/</a></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;br/&gt;
  &lt;div class="form-horizontal"&gt;
    &lt;div class="form-group"&gt;
      &lt;label class="control-label col-xs-3"&gt;From Date &lt;/label&gt;
         &lt;div class="col-xs-6"&gt;
            &lt;div class="input-group"&gt;
               &lt;input class="form-control" id="AddDateFromTxt" type="text" maxlength="10"&gt;
                 &lt;span class="input-group-btn"&gt;
                    &lt;button type="button" class="btn btn-default" id="AddDateFromBtn" title="Click here to select 'Add Date From'"&gt;&lt;i class="glyphicon glyphicon-calendar"&gt;&lt;/i&gt;&lt;/button&gt;
                 &lt;/span&gt;  
             &lt;/div&gt;
           &lt;/div&gt;
         &lt;/div&gt;
       &lt;/div&gt;  
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var fromDateCtrl = $('#AddDateFromTxt');
  
  $('#AddDateFromBtn').on('click', function () {
      fromDateCtrl.datepicker().datepicker("setDate", "-3").datepicker("show");        
  });
  </code></pre>
  
  <p><strong>Expectation</strong></p>
  
  <p>If I select 11/1/2015 on first time then, on the next click of calendar button, the values in textbox should not change to 11/4/2015 and should remain the same as 11/1/2015.</p>