How do I create a "check all" link for a web form?
<p>I've got a form with a bunch of checkboxes on it, and I'd like to provide a "check all" link/button.</p>

<p>I'm using the code below, but when it runs, it picks up some radio buttons on the page, and checks/unchecks those too. How do I fix this?</p>

<pre><code>var check = 0;
function doNow()
{
    void(d=document);
    void(el=d.getElementsByTagName('INPUT'));
    for(i=0;i&lt;el.length;i++)
    {
        if(check == 0)
            void(el[i].checked=1)
        else
            void(el[i].checked=0) 
    }
    if(check == 0)
        check = 1;
    else 
       check = 0;
}
</code></pre>
