Ok, i have this form (in php) that uses multiple selects and another name on multiple checkboxes. Well when doing multiple things you have to have name="blah[]" you have to add [] after the name, well when i tell the JS that the name of the field is blah[] it says not an object. How do i make it think its a the field instead of an object? Thanks for your help! Here is the JS i have. (note: it works without the [] on the name).

PHP Code:
function checkAll(subvalue) {
            
field document.form.permission[];
            
field2 document.form.categories[];
            if (
subvalue == "Admin") {
                for (
0<field.lengthi++) {
                    
field[i].checked true;
                    
field[i].disabled true;
                }
                for (
0field2.lengthi++) {
                    
field2[i].selected true;
                }
                
field2.disabled true;
            } else if (
subvalue == "Comment") {
                for (
i=0i<field.lengthi++) {
                    
field[i].checked false;
                    
field[i].disabled true;
                }
                for (
0field2.lengthi++) {
                    
field2[i].selected false;
                }
                
field2.disabled true;
            } else if (
subvalue == "Custom") {
                for (
i=0i<field.lengthi++) {
                    
field[i].checked false;
                    
field[i].disabled false;
                }
                for (
0field2.lengthi++) {
                    
field2[i].selected false;
                }
                
field2.disabled false;
            }
        }