title: Jquery datepicker date format
body: <p>How do I get my date to display like this: "yy-mm-dd" inside my date input textbox after I have selected a date?</p>
  
  <p>Information is reading from a database.
  So I need it saved in a database again.</p>
  
  <p>JavaScript:</p>
  
  <pre><code>&lt;script&gt;
    $(document).ready(function() {
    $("#from").datepicker();
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Html code:</p>
  
  <pre><code>&lt;div class="field"&gt;
          &lt;label&gt;Date&lt;/label&gt;
         &lt;input type="text" name="date" value="&lt;?php value('date'); ?&gt;" id="from" /&gt;   
          &lt;?php if(isset($errors['date'])) { ?&gt;
          &lt;div class="error"&gt;&lt;?php echo $errors['date']; ?&gt;&lt;/div&gt;
          &lt;?php } ?&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>Things that I have tried:</p>
  
  <p><a href="http://docs.jquery.com/UI/Datepicker#option-dateFormat" rel="nofollow noreferrer">http://docs.jquery.com/UI/Datepicker#option-dateFormat</a></p>
  
  <p><a href="http://docs.jquery.com/UI/Datepicker/formatDate" rel="nofollow noreferrer">http://docs.jquery.com/UI/Datepicker/formatDate</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7965371/jquery-ui-datepicker-date-format">jQuery UI DatePicker - Date Format</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6858425/jquery-ui-datepicker-date-format">jquery ui datepicker date format</a></p>