title: jquery cloning datepicker & submitName IE bug
body: <p>I'm currently stuck on a stupid thing for hours and I can't see the light at the end of the tunnel.</p>
  
  <p>I'm trying to clone a table in a form with autocompletion, datepicker &amp; other stuff based on a HTML template. I saw that the datepicker function generates an unique ID so I've made the template without the class and I add it during cloning. The funny thing is that the datepicker shows up but get stuck when I try to select a date.</p>
  
  <p>I've tried as well to change the name of the input contening the datepicker to be unique but it seems that IE has a funny bug of 'name' getting changed into 'submitName'</p>
  
  <p>Any help &amp; suggestions are welcome and appreciate. Here is my code below:</p>
  
  <pre><code>    &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;SCRIPT language="javascript"&gt;
          $(function() {
             $( ".datepicker" ).datepicker({ dateFormat: "dd/mm/yy" });
          });
      &lt;/SCRIPT&gt;
  
  
  
     &lt;button class="addLeg"&gt;Add Leg&lt;/button&gt;
     &lt;button class="delLeg"&gt;Remove Leg&lt;/button&gt;
    &lt;/span&gt;
  &lt;TABLE width="914px" border="0"&gt;
        &lt;TR align="center"&gt;
          &lt;TD width="23"&gt;&lt;/TD&gt;
          &lt;TD width="140" class="g1"&gt;Date&lt;/TD&gt;
          &lt;TD width="147" class="g1"&gt;Dep Time&lt;/TD&gt;
          &lt;TD colspan="2" class="g1"&gt;Routing&lt;/TD&gt;
          &lt;TD width="144" class="g1"&gt;Flight Time&lt;/TD&gt;
          &lt;TD width="142" class="g1"&gt;Pax&lt;/TD&gt;
        &lt;/TR&gt;
  &lt;/TABLE&gt;
  &lt;TABLE id="Leg" style="display:none" width="400px" border="0"&gt;
        &lt;TR &gt;
          &lt;TD class="g1"&gt;&lt;INPUT type="checkbox" class="delCheckLeg" name="chk"/&gt;&lt;/TD&gt;
            &lt;TD class="1"&gt;&lt;INPUT type="text" id="tripdate" name="tripdate"&gt;&lt;/TD&gt;
          &lt;TD class="g1"&gt;&lt;INPUT type="text" name="deptime"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="routingdep"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="routingarr"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="fttime"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="pax"/&gt;&lt;/TD&gt;
        &lt;/TR&gt;
  &lt;/TABLE&gt;
  &lt;div id="trip"&gt;
  &lt;TABLE id="Leg0" width="400px" border="0"&gt;
        &lt;TR &gt;
          &lt;TD class="g1"&gt;&lt;INPUT type="checkbox" class="delCheckLeg" name="chk"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" class="datepicker" id="tripdate0" name="tripdate0"&gt;&lt;/TD&gt;
          &lt;TD class="g1"&gt;&lt;INPUT type="text" name="deptime"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="routingdep"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="routingarr"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="fttime"/&gt;&lt;/TD&gt;
            &lt;TD class="g1"&gt;&lt;INPUT type="text" name="pax"/&gt;&lt;/TD&gt;
        &lt;/TR&gt;
      &lt;/TABLE&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      var uniqueId = 1;
      var uniqueLeg = 1;
      $('.addLeg').click(function() {
          var copy = $('#Leg').clone();
          var formId = 'Leg' + uniqueLeg;
          copy.attr('id', formId );
          copy.removeAttr('style');
  
          copy.find(':input#tripdate').each(function() {
              $(this).addClass('datepicker');
              $(this).datepicker({ dateFormat: "dd/mm/yy" });
  
              var dateid = 'tripdate' + uniqueLeg;
              $(this).attr('id', dateid ); 
  
                  });
  
          $('#trip').append(copy);
          uniqueLeg++;  
      });
  &lt;/script&gt;
  </code></pre>