jQuery datepicker only works once and is not shown the second time

后端 未结 10 1323
庸人自扰
庸人自扰 2021-01-02 06:32

ASP.NET MVC3 / jQuery 1.9.1 / jQuery UI 1.10.2

I\'ve got a page on which I open a modal dialog after clicking on an Ajax.ActionLink. Inside this dialog

10条回答
  •  既然无缘
    2021-01-02 06:58

    What worked for me was -

    Inside the dialog, if I have multiple inputs with class datepicker , then

    $(".datepicker").removeClass('hasDatepicker').datepicker();  
    

    Basically, to remove the class hasDatepicker before initializing datepicker again.

    I was on version 1.8.18 of jquery.ui.datepicker

提交回复
热议问题