I've been working on this for a week and am a web programmer that kind of learning as I go and I think this is simple, but my brain is fried........
How would I:
1) loop thru form to create array for each set of checkboxes with the same name
2) loop thru each array to make sure at least one checkbox has
been selected from each group - if not ... alert "Must
select at leach one checkbox from each Category"
Maybe create a validation function?:
whichCheckBoxArray = the Name of the checkbox to be checked, a string
myMin = 1 (the least you want the user to be able to check, an integer)
for all elements in form of type checkbox, named (var), make sure at
least one checkbox is selected
run function on submit......then proceed to next page if all is well
example sets:
<form action="add_selections.asp" method="post" name="subcategory">
<input type="checkbox" name="cksub4200" value=4201">
<input type="checkbox" name="cksub4200" value=4202">
<input type="checkbox" name="cksub4200" value=4203">
<input type="checkbox" name="cksub4200" value=4204">
<input type="checkbox" name="cksub4200" value=4205">
<input type="checkbox" name="cksub4200" value=4206">
<input type="checkbox" name="cksub4200" value=4207">
<input type="checkbox" name="cksub4200" value=4208">
<input type="checkbox" name="cksub4200" value=4209">
<input type="checkbox" name="cksub4400" value=4401">
<input type="checkbox" name="cksub4400" value=4402">
<input type="checkbox" name="cksub4400" value=4403">
<input type="checkbox" name="cksub4400" value=4404">
<input type="checkbox" name="cksub4400" value=4405">
<input type="checkbox" name="cksub4400" value=4406">
<input type="submit" value="Submit Form"><input type="Reset" value="Reset Form">
</form>
How would I:
1) loop thru form to create array for each set of checkboxes with the same name
2) loop thru each array to make sure at least one checkbox has
been selected from each group - if not ... alert "Must
select at leach one checkbox from each Category"
Maybe create a validation function?:
whichCheckBoxArray = the Name of the checkbox to be checked, a string
myMin = 1 (the least you want the user to be able to check, an integer)
for all elements in form of type checkbox, named (var), make sure at
least one checkbox is selected
run function on submit......then proceed to next page if all is well
example sets:
<form action="add_selections.asp" method="post" name="subcategory">
<input type="checkbox" name="cksub4200" value=4201">
<input type="checkbox" name="cksub4200" value=4202">
<input type="checkbox" name="cksub4200" value=4203">
<input type="checkbox" name="cksub4200" value=4204">
<input type="checkbox" name="cksub4200" value=4205">
<input type="checkbox" name="cksub4200" value=4206">
<input type="checkbox" name="cksub4200" value=4207">
<input type="checkbox" name="cksub4200" value=4208">
<input type="checkbox" name="cksub4200" value=4209">
<input type="checkbox" name="cksub4400" value=4401">
<input type="checkbox" name="cksub4400" value=4402">
<input type="checkbox" name="cksub4400" value=4403">
<input type="checkbox" name="cksub4400" value=4404">
<input type="checkbox" name="cksub4400" value=4405">
<input type="checkbox" name="cksub4400" value=4406">
<input type="submit" value="Submit Form"><input type="Reset" value="Reset Form">
</form>