Force
10-08-2003, 11:00 AM
I'm using the following code to validate three checkboxes to ensure that they are checked. The message pops up fine if any are not checked. However, it then submits the form anyway. I'm not seeing what I've done wrong. Thanks for the help. I really appreciate it.
<script language="JavaScript">
function doublecheck(theForm) {
if (
theForm.pledge.checked == false ||
theForm.contact.checked == false ||
theForm.spread.checked == false
)
{
alert ('All 3 boxes must be checked. Thank you.');
return false;
} else {
return true;
}
}
</script>
This is how I'm calling it.
<form action="regcflact.cfm" name="myForm" onsubmit="doublecheck(this);" method="post">
<script language="JavaScript">
function doublecheck(theForm) {
if (
theForm.pledge.checked == false ||
theForm.contact.checked == false ||
theForm.spread.checked == false
)
{
alert ('All 3 boxes must be checked. Thank you.');
return false;
} else {
return true;
}
}
</script>
This is how I'm calling it.
<form action="regcflact.cfm" name="myForm" onsubmit="doublecheck(this);" method="post">