title: Duplicate jquery ui problem
body: <p>I'm working on a Django project. But my problem is on JQuery.
  I used <a href="http://code.google.com/p/django-dynamic-formset/" rel="nofollow noreferrer">jquery.formset.js</a> JQuery plugin to add form dynamically in inline_formsets, formset_factories. And this works pretty nice. It duplicates the first row elements with its other decoration tags (like div, span, img..) and adds the new row in the bottom of the table. So the duplicated row can be appeared just like the origin.</p>
  
  <p>I also uses <a href="http://jqueryui.com/demos/" rel="nofollow noreferrer">jquery ui (datepicker, autocomplete..etc)</a> in my forms. </p>
  
  <p>The duplication copies everything, even the appended htmls by the datepickers and autocompletes, because the plugin tries not to leave any interface pieces. When it clones the first row, everything is cloned, even the events are cloned. So when i click on the newly appeared datepicker input the calendar event works on the first row's element.</p>
  
  <p>I'm trying to find the decision. Here are what in my mind so far..</p>
  
  <ol>
  <li><p>Declare the jquery ui (datepicker and autocomplete) as <strong>live</strong>? like</p>
  
  <p>$(".dates").live('...', function() { $(this).datepicker(); } )</p>
  
  <p>But I'm not sure which event should be handled for this. I guess it's impossible to handle the new created or appended elements.</p></li>
  <li><p>Putting the script inside the row? right after the element</p>
  
  <p></p>
  
  
   $("#id_birthday_1").datepicker();
  
  
  <p>It seems the best idea, but the duplication has already duplicated the extra elements/htmls. So it will re-render the element.</p></li>
  <li><p>Should I edit the js plugin? like binding all the jquery ui's events' declarations, excepting the renders and appending and styling. That would be a huge mess. I don't want to mess up like this.. And every time if i need to add a new ui, i should edit that js constantly</p></li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/qglIM.jpg" alt="alt text"></p>
  
  <p>Every ideas would be appreciated :)</p>