title: Splitting a jQuery DatePicker into hidden fields
body: <p>We have a PHP booking system that by using 6 drop lists sends 6 hidden variables to the results page for a date search.</p>
  
  <p>start_day, start_month, start_year, end_day, end_month, end_year</p>
  
  <p>I would however like to use 2 jQuery datepickers and lets say for sake of argument they are set up with the following date formatting.</p>
  
  <pre><code>$( "datefrom_picker" ).datepicker( "option", "getDate", "dd-mm-yy" );
  $( "datefrom_picker2" ).datepicker( "option", "getDate", "dd-mm-yy" );
  </code></pre>
  
  <p>My question is is there a way of splitting the jQuery datepicker date format so that it can send the six date parts to the results page? For example i have attempted probably badly to figure this out for the first calendar..</p>
  
  <p>The hidden form fields:</p>
  
  <pre><code>&lt;input name="start_month" id="start_month" type="hidden" value="" /&gt;
  &lt;input name="start_day" id="start_day" type="hidden" value="" /&gt;
  &lt;input name="start_year" id="start_year" type="hidden" value="" /&gt;
  </code></pre>
  
  <p>The jQuery</p>
  
  <pre><code>$( "#datefrom_picker" ).datepicker( "option", "getDate", "dd-mm-yy" );
        toDateModComboFlights = ($('#datefrom_picker').datepicker("getDate"));
          if (toDateModComboFlights!=null) {
              document.forms['frmCheckAvailability'].elements['start_day'].value = toDateModComboFlights.dd();
              document.forms['frmCheckAvailability'].elements['start_month'].value = toDateModComboFlights.mm();
              document.forms['frmCheckAvailability'].elements['start_year'].value = toDateModComboFlights.yy();
  }
  </code></pre>
  
  <p>Thanks for any help in the right direction.</p>