Jquery set date to input value
<p>I have <strong>start_date</strong> datepicker and after some calculation result shown on <strong>date_result</strong> textfield and its working fine, here is code:</p>

<pre><code>jQuery(document).ready(function($) {
    $('start_date, #week_number, #year_number, #month_number').change(function() {
        var yr = $('#year_number').val() * 365;
        var wk = $('#week_number').val() * 7;
        var days = yr + wk;
        var endDate = new Date($('#start_date').val());
        endDate.setDate(endDate.getDate() + Number(days));
        $('#date_result').val(endDate.getFullYear() + '-' + (endDate.getMonth() + 1) + '-' + endDate.getDate());
    });
});
</code></pre>

<p>Here is: <a href="https://jsfiddle.net/8epztLv2/7/" rel="nofollow">Fiddle</a></p>

<p><strong>Problem:</strong> The date_result input value is empty, how can I set this value with calculated date?</p>

<pre><code>&lt;input type="text" value="" size="20" name="form[date_result]" id="date_result"&gt; 
</code></pre>