Jquery datepicker does not work inside lightbox

后端 未结 4 1936
失恋的感觉
失恋的感觉 2020-12-22 10:10

After some problems solved, I got a tricky stuff. I am using an overlay plugin for JQuery called prettyPhoto.

Just wanna make an overlay with a form. The form is hid

4条回答
  •  半阙折子戏
    2020-12-22 10:49

    Using the solution proposed here I manage to make the datepicker appear/disapear in a lightbox (prettyphoto) BUT still with a javascript error (f is null) when selecting a date.

    After couple of hours here's my complete solution :

    $("#datepicker").live('focus', function(){ 
                     $(this).attr("id","datepickerNEWID");                 
                     $(this).datepicker();
    });
    

    Because lightbox creates a new DOM with a copy of the div content we then have 2 input with same ID that causes datepicker to not work so what I do is change the datepicker id.

    Hope it helps!

提交回复
热议问题