Hi,

I am trying to validate a checkbox selection but my code doesn't work. Here is the code I have:

HTML Code:
<form action="form.php" method="post" onsubmit="return validate(this);">
        Options:
	<input type="checkbox" name="options[]" value="Option 1" /> Option 1<br />
	<input type="checkbox" name="options[]" value="Option 2" /> Option 2<br />
	<input type="checkbox" name="options[]" value="Option 3" /> Option 3
	<input type="submit" name="submit" value="Submit" />
</form>
<script type="text/javascript">
	<!--
	function validate(form) {
		if(form.options[0].checked==false && form.options[1].checked==false && form.options[2].checked==false) {
			alert('Please check at least one of the options.');
			return false;
		}
		return true;
	}
	//-->
</script>
Thanks for any help.