Pre populate date into another field on pageload
<p>I am trying to get the date selected on page load, which is 4 days onwards from today date on page load, to auto populate my field which is in the sidebar for the user to be able to see which date is selected for delivery.</p>

<p>I have managed to get the date to populate the field, but only once it has been clicked. When the page loads it automatically highlights the current day which means the user could proceed without selecting a date if they just look at the datepicker as my datepicker is visible at all times like a calendar.</p>

<p>I have pasted my code below, my datepicker is in #calendar and the value is populating #alternate. What I need is #alternate to be auto populated in the same date format on page load, as at the moment it is blank until you click a day.</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(function() {
$( "#calendar" ).datepicker({ minDate: +4, maxDate: "+1M +4D", dayNamesMin: ['Mon', 'Tue',        'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], prevText: '&lt;&lt;', nextText: '&gt;&gt;', changeMonth: false, changeYear: false, altField: "#alternate", altFormat: "DD, d MM, yy", gotoCurrent: false, defaultDate: '+4'});}); 
&lt;/script&gt;

 &lt;div id="calendar"&gt;&lt;/div&gt;

 &lt;input type="text" id="alternate" name="delivery-date"/&gt;
</code></pre>

<p>Any help would me much appreciated.</p>

<p><strong>EDIT</strong></p>

<pre><code>&lt;script type="text/javascript"&gt;
$(function() {
$( "#calendar" ).datepicker({ minDate: +4, maxDate: "+1M +4D", dayNamesMin: ['Mon', 'Tue',    'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], prevText: '&lt;&lt;', nextText: '&gt;&gt;', changeMonth: false, changeYear: false, altField: "#alternate", altFormat: "DD, d MM, yy", gotoCurrent: false,  defaultDate: '+4'});
var today = new Date();
today.setDate(today.getDate()+4);
future =(today.getMonth()+1) + '/' + today.getDate() + '/' + today.getFullYear();

$("#alternate").append($.datepicker.formatDate('D, dd M yy', today));
});
&lt;/script&gt;
</code></pre>
