Remove Datepicker Function dynamically

后端 未结 6 1545
时光取名叫无心
时光取名叫无心 2020-12-03 02:31

I want to remove datepicker function depending on the dropdownlist selected value. I try the following codes, but it still shows the calendar when I put the cursor in the t

6条回答
  •  执念已碎
    2020-12-03 03:12

    what about using the official API?

    According to the API doc:

    DESTROY: Removes the datepicker functionality completely. This will return the element back to its pre-init state.

    Use:

    $("#txtSearch").datepicker("destroy");

    to restore the input to its normal behaviour and

    $("#txtSearch").datepicker(/*options*/);

    again to show the datapicker again.

提交回复
热议问题