title: Using JQuery datepicker: default date isn't saved in the field until the icon is selected
body: <p>I have a web form with a 'from' date and a 'to' date. Both use the jQuery datepicker, with the 'from' date defaulting to today and the 'to' date defaulting to tomorrow.</p>
  
  <p>If I just accept the defaults, the 'from' date is correctly recorded in the database but the 'to' date is simply recorded as "00/00/0000". However, if I use the calendar widget to actually set a date, then it works fine.</p>
  
  <p>Here is my code for the two datepickers (just called datepicker1 and datepicker2 for now):</p>
  
  <pre><code>  $("#datepicker1").datepicker({ dateFormat: 'dd/mm/yy',
                          changeMonth: true,
                          changeYear: true,
                      showOn: "button",
                      buttonImage: "images/15.gif",
                      buttonImageOnly: true,
                      autoSize: true,
                                  minDate: 0,
                                  onSelect: function(dateText,picker) {
                                  $('#day').val( dateText.split(/\//)[0] );
                                  $('#month').val( dateText.split(/\//)[1] );
                                  $('#year').val( dateText.split(/\//)[2] );
                                  } 
                                });
   $("#datepicker2").datepicker({ dateFormat: 'dd/mm/yy',
                          changeMonth: true,
                          changeYear: true,
                      showOn: "button",
                      buttonImage: "images/15.gif",
                      buttonImageOnly: true,
                      autoSize: true,
                                  minDate: 0,
                                  onSelect: function(dateText,picker) {
                                  $('#exp_day').val( dateText.split(/\//)[0] );
                                  $('#exp_month').val( dateText.split(/\//)[1] );
                                  $('#exp_year').val( dateText.split(/\//)[2] );
                                  } 
                                });
   $('#datepicker1').datepicker('setDate', new Date());
   $('#datepicker2').datepicker('setDate', '+1d')
  </code></pre>
  
  <p>And my two input fields are simply:</p>
  
  <pre><code>&lt;input id="datepicker1" class="datepicker" /&gt;
  &lt;input id="datepicker2" class="datepicker" /&gt;
  </code></pre>
  
  <p>So far, the only thing I have checked is the format of the fields in the database, but they are identical. Which leans me to think this is a problem with how I have set up the datepickers.</p>
  
  <p>Any pointers to how I can fix this? Thanks everyone.</p>