datepicker won't fire an onchange event

前端 未结 1 877
面向向阳花
面向向阳花 2021-01-16 11:19

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

相关标签:
1条回答
  • 2021-01-16 11:46
    $('#date1').datepicker({ minDate: +1,onSelect: function(selectedDate) {
    
    
        var date = $(this).datepicker('getDate');
    
        date.setDate(date.getDate() + parseInt(duration)); // Add 7 days
    
        $('#date1').trigger('change');
      }});
    
    0 讨论(0)
提交回复
热议问题