I have 2 sets of checkboxes and I don't want the customer to submit the form unless they have checked at least one checkbox in either set.
I am giving each set of checkboxes the same name because of the code used to send the information through an e-mail.
This is what I have:
I think I have to use unique id's for each checkbox but I don't know how to change the javascript validation code for that.
I am giving each set of checkboxes the same name because of the code used to send the information through an e-mail.
This is what I have:
Code:
<script language="javascript" type="text/javascript">
<!--
function checkCheckBoxes() {
if (document.Needs_Assessment.Communication_Skills.checked == false &&
document.Needs_Assessment.Professional_Development.checked == false)
{
alert ('Please select at least one class prior to submitting this survey.');
return false;
}
else
{
return true;
}
}
//-->
</script>
<form method="POST" action="Response.asp" name="FrontPage_Form1" onsubmit="return checkCheckBoxes(this)" action="">
<input type="checkbox" name="Communication_Skills" value="Counseling Improved Performance">Counseling Improved Performance
<input type="checkbox" name="Communication_Skills" value="Choose Your Battles">Choose Your Battles
<input type="checkbox" name="Communication_Skills" value="Documentation and File Building">Documentation and File Building
<input type="checkbox" name="Professional_Development" value="CPR/First Aid">CPR/First Aid
<input type="checkbox" name="Professional_Development" value="Creating Your Career">Creating Your Career
<input type="checkbox" name="Professional_Development" value="How to Build Self-Esteem">How to Build Self-Esteem
I think I have to use unique id's for each checkbox but I don't know how to change the javascript validation code for that.