jQuery setting of radio button using eq fails
<p>In the code below, <code>plane.posFile</code> is a string array of length 3 that identifies 3 radio buttons, and the buttons display correctly.</p>

<p>If <code>oSource.posfile</code> is a blank string, the 0th button gets checked correctly.</p>

<p>If <code>oSource.posfile</code> is not blank, it is one of the three in <code>plane.posFile</code> except that the file extensions have to be stripped for the comparison. </p>

<p>What happens is that the code correctly (using Firebug to step through it) chooses which index to use. </p>

<p>It goes through into the break statement and then out with <code>i=1</code>. </p>

<p>However, the attempt to set when <code>eq(i)</code> the <code>attr('checked',true)</code> files. I don't see why. It's the same statement as previously when <code>eq(0)</code> was used. I've been staring at it for a couple of hours trying things with no luck. </p>

<p>Any ideas are greatly appreciated, including comments on the approach.</p>

<pre><code>$wb.pcPosCfg.empty();
for (i=0; i&lt;plane.posFile.length; i++)
     $wb.pcPosCfg.append("&lt;input type='radio' style='width:11px' name='rbnLoadCfg' value=" + i + "&gt;" + plane.posFile[i] + "&lt;br&gt;");
    if (oSource.posfile=='') {
        $('input[name="rbnLoadCfg"]:eq(0)').attr('checked',true);
    }
    else {
        for (i=0; i&lt;plane.posFile.length; i++) {
            if (oSource.posfile==plane.posFile[i].substring(0,plane.posFile[i].length-5))
                break;
            }
        $('input[name="rbnLoadCfg"]:eq(i)').attr('checked',true);
    }
}
</code></pre>
