Help with JavaScript reading checkbox with []
<p>i have written/modified a script to count checkboxes checked it works fine but i know need the checkbox name to read r1[] for my php scripts and now it doesn't work please help with java script...</p>

<p>THIS WORKS</p>

<pre><code>&lt;input name='r1' type='checkbox' value='' onClick='return GetSelectedItem2()' /&gt;
</code></pre>

<p>THIS DOES NOT WORK</p>

<pre><code>&lt;input name='r1[]' type='checkbox' value='' onClick='return GetSelectedItem2()' /&gt;
</code></pre>

<p>JAVASCRIPT</p>

<pre><code>function GetSelectedItem2() {
    chosen = ""
    numCheck = 0
    len = document.f1.r1.length

    for (i = 0; i &lt; len; i++) {


        if (document.f1.r1[i].checked) {
            numCheck++
            if (numCheck == 3) {
                alert("Only pick two date")
                document.f1;
                return false;
            }
        }
    }
}
</code></pre>
