I am using a checkbox that has the name as "selectedids[]" and I am trying to select all checkboxes with the JavaScript. The code is not working. When I change the name of the checkbox to "selectedids" it works, but I can't do so because I need all the ids that are selected on the POSTED page.

The checkbox is as follows:

```
foreach($rows as $row)
{
<input type="checkbox" name="selectedids[]" value="<?php echo $row['id']; ?>" class="checkbox" />
........
........
}

```

And the Java-script function is as follows:

```
function SetAllCheckBoxes(CheckValue)
{
    var CheckValue=true;
    if(!document.forms['main'])
        return;
    var objCheckBoxes = document.forms['main'].elements['selectedids[]'];
    if(!objCheckBoxes)
        return;
    var countCheckBoxes = objCheckBoxes.length;
    if(!countCheckBoxes)
        objCheckBoxes.checked = CheckValue;
    else
        // set the check value for all check boxes
        for(var i = 0; i < countCheckBoxes; i++)
            objCheckBoxes[i].checked = CheckValue;
}

```

Please help me......

Thanks in advance.......