I am trying to make a radio button required (Oliftgate) if another radio button (OType) is equal to a certain value (NoDock). I've got other required fields that are working, but this one is not. Probably because I am combining things and am likely doing it wrong.

Any ideas?

code:

if (form.OType.value == "NoDock" && form.Oliftgate.value == "") { //This checks to see if the liftgate option is filled in when Business Without Doc is equal to No Dock
alert("You must answer the liftgate question when selecting this option.");
form.Oliftgate.focus(); //This focuses the cursor on the empty field
return false; //This prevents the form from being submitted
}


Thanks in advance!