I have some fields on a form. If one particular field (potentialvendorcomplete)equals the value “yes” AND another field (potentialvendor1) is blank, then i don’t want the form to be submitted and an alert message to appear.
However, using the logical code below, the alert comes up if potentialvendorcomplete = No. If potentialvendorcomplete = No then the alert should not come up! Any idea why this is not working?
[CODE]
function validateForm(form) { //This is the name of the function
if (form.potentialvendor1.value == “” && form.potentialvendorcomplete.value == “Yes”); { //This checks to make sure the field is not empty
alert(“You must enter a vendor to complete vendor sourcing”); //Informs user of empty field
form.potentialvendor1.focus( ); //This focuses the cursor on the empty field
return false; //This prevents the form from being submitted
}
//example
return true
}
</SCRIPT>