I'm trying to make a checkbox that fills in a set of checkboxes within a form.
For example.
<input type="checkbox" name="box_name[]" value="1">
<input type="checkbox" name="box_name[]" value="2">
<input type="checkbox" name="box_name[]" value="3">
<input type="checkbox" name="box_name[]" value="4">
I then have a checkbox that runs a function that checks all of the above.
If these were radio button, it would be a cinch:
(loop through
form_name.box_name.checked = true
)
But JS won't allow me to identify check boxes within an array.
If someone could just tell me how to call a specific checkbox within this list, I would gratly appreciate it.
I have tried:
document.form_name.box_name
document.form_name.box_name.options[form_name.box_name]
and even
document.form_name.box_name[]
Thanks in advance for any help you can toss my way!
Jon