i'm loading some post variables into a php array by combining them as such:
but i can't figure out how to validate that a box has been checked via javascript. at least, i can't reference those checkboxes by name, ie by document.myform.array or document.myform.array[], due to either the brackets or just the multiple elements with the same name.
is there a way to reference those boxes without calling them by name? like, forms[0].elements[somethingsomething] etc? i'm unclear on the DOM and how it describes forms.
thanks...
Code:
<form name="myform" action="action.php" method="post" onSubmit="return myValidateFunction()">
<input type="checkbox" name="array[]" value="value1">
<input type="checkbox" name="array[]" value="value2">
<input type="checkbox" name="array[]" value="value3">
<input type="checkbox" name="array[]" value="value4">
<input type="submit" value="Go">
</form>
but i can't figure out how to validate that a box has been checked via javascript. at least, i can't reference those checkboxes by name, ie by document.myform.array or document.myform.array[], due to either the brackets or just the multiple elements with the same name.
is there a way to reference those boxes without calling them by name? like, forms[0].elements[somethingsomething] etc? i'm unclear on the DOM and how it describes forms.
thanks...