Forum Moderators: open
alert(document.reply.cb.length); works if my checkboxes look like this:
<input type="checkbox" name="cb" value="1" />
<input type="checkbox" name="cb" value="2" />
But they don't, they look like this:
<input type="checkbox" name="cb[]" value="1" />
<input type="checkbox" name="cb[]" value="2" />
I've even tried changing my alert test to this:
alert(document.reply.cb[].length);
I need the cb to have the [] suffix so I can pass multiple values through to the receiving page. Isn't that what checkboxes are for?
Checkboxes are intended to be independent elements, not influenced by other checkboxes in a page. As such, they should have independent names. Normally, it is only a group of radio buttons which share a name.