Search code examples
jqueryjquery-uifindjquery-selectors

get next or live element with jQuery find


Alright, not sure if find() will be the correct method for this. I am using pretty photo and I am loading some inline content. Basically when pretty photo launches, it clones what is defined inline and displays it in the lightbox.

The issue here is I cannot call $("#myTextField").datepicker(); to activate a jQuery UI Datepicker on a text box. The reason being is it applies it to the invisible one I originally wrote, not the cloned one that is visible. I ran into this issue before with the Submit button in the inline content which I solved by using $("#mySubmitButton").live('click',function().....

I tried $(this).find("#myTextField").next().datepicker(); but no dice. Any other suggestions? I dont know how else I could use the live() method.


Solution

  • Alright I figured it out via: Jquery datepicker does not work inside lightbox

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