Is it possible to have a checkbox validate a radio button? I have two radio buttons (Free Lunch and Reduced Lunch). If the user chooses either of these, the checkbox below (Please agree to the release of school information about your lunch program...) must be checked. This checkbox ONLY needs to be selected IF one of the radio buttons is selected. So far I'm trying to do this in javascript.
Here's what I have now that is not working. When testing the form, I'm selecting a radio button, and not selecting the checkbox and the form submits anyway.
Here's what I have now that is not working. When testing the form, I'm selecting a radio button, and not selecting the checkbox and the form submits anyway.
Code:
function validateLunchSelection()
if((form2.lunch_program[0].checked==true || form2.lunch_program[1].checked==true) && (form2.lunch_auth.checked==false))
{
alert("Please agree to release of lunch information from your school");
form2.lunch_auth.focus();
return false;
}
Comment