I am trying to validate a form using Java, but cannot get it to work, what is supposed to happen is that, if CustomerNotReached or Deactive is checked the form will submit, otherwise the user has to enter in the rest of the fields. I know this is a java question, but hope you can help anyway. Here is the script:
<SCRIPT LANGUAGE="JavaScript">
function validate(f){
if (f.CUSTOMERNOTREACHED.checked == 1 )
{
return true;
}
if (f.DEACTIVATE.checked == 1 )
{
return true;
}
if ((f.Q1.selectedIndex == -1)(f.Q2.selectedIndex==-1)(f.Q3.selectedIndex == -1)(f.Q4.selectedIndex == -1)(f.Q5.selectedIndex == -1)(f.COMMENTS.value))
{
return false;
}else
return true;
}
</script>