How do I clear/reset the selected dates on the jQuery UI Datepicker calendar?

后端 未结 16 1658
感情败类
感情败类 2020-12-02 07:19

How do I reset the datepicker calendar values?.. The min and max date restrictions?

The problem is that when I clear the dates (by deleting the textbox values), th

16条回答
  •  执念已碎
    2020-12-02 07:35

    Try changing the clearing code to:

    $('#clearDates').on('click', function(){
        dates.attr('value', '');
        $("input[id$='dpFrom'], input[id$='dpTo']").datepicker( "option", "maxDate", null );
        $("input[id$='dpFrom'], input[id$='dpTo']").datepicker( "option", "minDate", null );
    });
    

提交回复
热议问题