|
Hi, javascript newbie here.
While creating some checkboxes I've named all the checkboxes the same.
<input type="checkbox" name="check_list[]" value="1">
<input type="checkbox" name="check_list[]" value="2">
<input type="checkbox" name="check_list[]" value="3">
<input type="checkbox" name="check_list[]" value="4">
Normally, I'd be able to get the number of elements in the array with the following, if I hadn't included the brackets in the name:
document.MyForm.check_list.length;
However, when the name contains brackets, which I'm pretty certain is what is causing the problem, I'm not able to use my ordinary method.
Got any idea how to get the number of elements now?
|