Hi, After inserting the clone to DOM you should apply datepicker to the DOM rather than the copy variable. Something like this:
$('#newDraftLine').click(function(){ var row = $('#draft tr:last'); var copy = row.clone(); copy.insertAfter(row); $('#draft tr:last').find('.datepicker').attr('id','').datepicker(); }); On Sun, Jan 4, 2009 at 3:38 AM, Mickiii <michael.la...@gmail.com> wrote: > > Hi, > > I have this function for a table form: > > $('#newDraftLine').click(function(){ > var row = $('#draft tr:last'); > var copy = row.clone(); > copy.insertAfter(row); > copy.find('.datepicker').attr('id','').datepicker(); > }); > > Why is it that the datepicker does not work when the cloned input is > in focus? For all elements in place when the page loads it works, but > for this cloned element nothing happens. I can see that the input is > assigned an id utilized by the datepicker. > > If this turns out to be a newbie question, please bare with me. I have > used mootools for a few years now, but recently decided to start using > jquery. > > Thanks > -- Ca-Phun Ung + http://yelotofu.com + hongkong, zce, jquery, php, css, html