I have a set of checkboxes in a form that have subscripted names so that I can pass them to a PHP script as an array. However, I need to do some client side checking first (at least one must be checked). I can't seem to get the right syntax in my javascript so that I can check the values.
When I refer to 'theForm.carrier.length' I get an error saying it has no properties. How do I reference the object so that I can loop through to make sure at least one is checked? TIA.
Code:
<input name="carrier[0]" type="checkbox" value="blah">blah
<input name="carrier[1]" type="checkbox" value="blah2">blah2
<input name="carrier[2]" type="checkbox" value="blah3">blah3
<input name="carrier[3]" type="checkbox" value="blah4">blah4