You could write dynamic code... 😉
I mean it. Have PHP write the Javascript form validation function to match the form it's validating.
And yes, you can refer to form fields that have '[]' in their name in Javascript I've been told something like (though don't quote me, 'cos that ain't DOM1-standard):
box=document.FormName.elements['varname[]'];
box[i].checked=false;
would work.