<script type="text/javascript">
function CheckForm() {
var count = 0;
//Please place the code here
}
</script>
<form name="myform" onSubmit="return CheckForm()">
<input type="checkbox" value="red" name="check1" />red<br />
<input type="checkbox" value="green" name="check2" />green<br />
<input type="checkbox" value="blue" name="check3" />blue<br />
<input type="checkbox" value="yellow" name="check4" />yellow<br />
.....
<input type="checkbox" value="gray" name="check100" />gray<p>
<input type="checkbox" value="1" name="other1" />1<br />
<input type="checkbox" value="2" name="other2" />2<br />
<input type="checkbox" value="3" name="other3" />3<br />
<input type="submit" value="Submit">
</form>
Ok heres what i need. please complete the form validation on top.
But :
1. checkbox name must not change (it must be check1 up to check100 or more)
2. the validation MUST be some kind of a loop checking every checkbox if they are checked so that i dont have to write hundred lines of codes just to check each.
3. when a particular checkbox is checked. count will increment. count++;
4. take note of the other 3 checkboxes, they must NOT be included in the validation. only checkbox having a word "check" on their names will be validated
<input type="checkbox" value="1" name="other1" />1<br />
<input type="checkbox" value="2" name="other2" />2<br />
<input type="checkbox" value="3" name="other3" />3<br />
- at the end of the validation maybe we can put an alert() containing the value of count
Thank for any help