I have two input date field, one generates a date through JQuery datepicker, I wanr the second to take the value from the first input via onblur or onchange event, it works
$('#date1').datepicker({ minDate: +1,onSelect: function(selectedDate) { var date = $(this).datepicker('getDate'); date.setDate(date.getDate() + parseInt(duration)); // Add 7 days $('#date1').trigger('change'); }});