Hi all,

I am pulling my hair out on this one because it's so trivial, yet I figure it out. So basically I have a form that has a series of checkboxes

Code:
table id="restaurant_types_table">
<tr>
<td><input type="checkbox" name="restaurant_types[]" value="1"> Afternoon Tea</td>
<td><input type="checkbox" name="restaurant_types[]" value="2"> Bakery</td>

</tr>
<td><input type="checkbox" name="restaurant_types[]" value="3"> Breakfast/ Brunch</td>
<td><input type="checkbox" name="restaurant_types[]" value="4"> Café</td>
</tr>
<td><input type="checkbox" name="restaurant_types[]" value="5"> Dessert</td>
(yes yes I am using tables...just be quiet). All my checkboxes are part of the array restaurant_types[]. Using javascript, I would like to ensure that at least ONE checkbox is checked.

So i figure the code would be like

Code:
if (form.restaurant_types.length < 0)
alert("Please check more than one!!");
But I think that is incorrect, because the length would actually be all the checkboxes, and not just the checked ones. But the problem is I can't even seem to access the form array and I don't know what I am doing wrong.

Can anyone help me?

Thanks