I have a form with two checkboxes on. I am trying to make it so either one or the other have to be selected before the form submits. I know it should be easy but I have probably been looking at too much code today to notice whats wrong
here is the code
If anyone can help it would be much appreciated
here is the code
Code:
<script language="JavaScript">
<!--
function sendforms()
{
txt=document.form1.seminar.value;
txt1=document.form1.yes.value;
txt2=document.form1.no.value;
if (txt.length == 0) {
alert("Please select a seminar date");
return;
}
if (txt1 == "Yes" && txt2 == "No") {
alert("Please select whether you would like to be kept informed on future seminars");
return;
}
if (txt1 !== "Yes" && txt2 !== "No"){
alert("You have selected yes and no please select only one");
return;
}
document.form1.submit();
}
//-->
</script>
If anyone can help it would be much appreciated