I have a set of checkboxes in a form as follows:
<form name="form1" onsubmit="return window.Validate()" method="post" action="myprog.cgi">
<div id="filters">
<input name="One_f" type="checkbox"> No. 1<br>
<input name="Two_f" type="checkbox"> No. 2<br>
<input name="Three_f" type="checkbox"> No. 3<br>
</div>
<div id="Colors">
<input name="Red" type="checkbox"> Red<br>
<input name="Blue" type="checkbox"> Blue<br>
<input name="Green" type="checkbox"> Green<br>
</div>
<div id="Button">
<input name="Submit" value="Submit" type="submit">
</div>
</form>
I want to write a function Validate in Javascript that would see whether any of the checkboxes in the div id
filters is checked. If none of them is checked, it should show an alert box and prevent the cgi from
getting executed. The checkboxes in the div filters all have their names ending in _f, if that helps.
How do I write such a function?