JQuery IE7 clone returns '0' is null or not an object
<p>I'm using jquery-1.6 with jquery-validation-1.9.0, jquery.form.2.36, jquery-ui-1.8.2 plugins.</p>

<p>I copy of the following block of code, which can contain one to many radio buttons which are grouped by element name 'corsdt'</p>

<pre><code> &lt;div class="container-wrapper"&gt;
....
    &lt;div class="rght-container"&gt;
       &lt;input type="radio" name="corsdt" id="rad_corsdt_1" class="radio ui-widget-content ui-corner-all" value="course_title=Fundamentals%20for%20New%20Managers&amp;amp;course_code=341.564&amp;amp;mercref=341.564-12-HI-03" /&gt;
    &lt;/div&gt;
 &lt;/div&gt;
</code></pre>

<p>and append it to a form, using jquery</p>

<pre><code>var $clone = $('.container-wrapper').clone();

    var crsrads = $clone.find("input:radio[name=corsdt]");

var no_of_rad = crsrads.length + 1; //find total no. of orig radio inputs, incr ids to avoid duplicate ids
    crsrads.each(function(index){
        var i = index + no_of_rad;
        $(this).attr({id: 'rad_corsdt_' + i, name: 'corsdt1'});
    });

 $('#dialog-dtwrapper').append($clone); 
</code></pre>

<p>This appends to the target div tag within a form, as expected</p>

<pre><code>&lt;div id="dialog-dtwrapper"&gt;
      &lt;div class="container-wrapper"&gt;
       ....
         &lt;div class="rght-container"&gt;&lt;input id="rad_corsdt_2" class="radio ui-widget-content ui-corner-all ez-hide valid" type="radio" value="course_title=Fundamentals%20for%20New%20Managers&amp;amp;course_code=341.564&amp;amp;mercref=341.564-12-HI-03" name="corsdt1"&gt;
      ...      
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>However when I try to validate the form, using the validation plugin, I get an, '0' is null or not an object, error in IE7.</p>

<pre><code>var aform = $("#formName").validate({
....
rules: {
 ....
  corsdt1 : "required",
 ....
},
messages: { 
....
 corsdt1 : "please select a course date",

},
submitHandler: function(form) {....
</code></pre>

<p>I assume that this is related to the clone method which in some instances causes a bug in IE7.Is there a work around for this?</p>

<p>As this works fine in Firefox, IE8 &amp; Chrome.</p>

<p>Cheers.</p>
