title: jQuery - datepicker fails to activate on element inserted after page load
body: <p>I have a div that can be filled with 3 different layouts for entering dates and times.</p>
  
  <p>This is the html that gets loaded by one of the layouts:</p>
  
  <pre><code> &lt;div class="row clearfix input-field"&gt;
    &lt;div class="span10 date-selection"&gt;
      &lt;div class="input-prepend date-time"&gt;
       &lt;input class="date-input" name="date" size="16" type="text" value=""&gt;
      &lt;/div&gt;
      &lt;div class="input-prepend date-time"&gt;
       &lt;input class="time-input" name="time" size="16" type="text" value=""&gt;
      &lt;/div&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>I then use live to manage the listeners like this</p>
  
  <pre><code>$('.date-input').live 'click', (e) -&gt;
      $(this).datepicker({showOn:'focus'}).focus()
  $('.time-input').live 'click', (e) -&gt;
    $(this).timepicker({showOn:'focus'}).focus()
  </code></pre>
  
  <p>This works fine but I also have a link to create a new set of date and time fields.</p>
  
  <pre><code>$(".add-lesson").live 'click', (e) -&gt;
      e.preventDefault()
      lesson = $('.multiple-lessons .row:first').clone()
      $(".multiple-lessons .row:last").after(lesson)
      $(".multiple-lessons .row:last input.date-input").attr('name', 'date2')
      $(".multiple-lessons .row:last input.date-input").attr('id', 'new-date-id')
      $(".multiple-lessons .row:last input.time-input").attr('name', 'time2')
      $(".multiple-lessons .row:last input.time-input").attr('id', 'new-time-id')
  </code></pre>
  
  <p>In the final code I will be generating better names that are valid for saving in rails so the names and ids above are just for testing.</p>
  
  <p>THE PROBLEM</p>
  
  <p>The pickers work with the original live elements but not the cloned ones.
  Strangely if I don't use the picker and add loads of new rows using clone all the cloned rows work with the pickers.</p>
  
  <p>I am using the latest jQuery and jQuery ui</p>
  
  <p>Any ideas?</p>