Hi all,
I'm writing my first few bits of script. I want to validate a form that has two drop downs. If the first drop down is not set to a value from the list (ie it must not == -Select-) then the script should show an alert then cancel submit. If the first drop down succeeds then test the second similarly. What ever I do the first drop down fails. I always get a message in the status bar of the form with my error message. My condition looks like
if ((form.field != "Option 1") || (form.field != "Option 2"))
{
alert "Invalid data. Try again.";
cancel submit;
}
and the second is identical but inside an elseif. The strings in "" are just copied from the form definition. I'm attaching this to the form on validate action.
Am I doing something very obviously wrong that anyone can see?
Thanks in advance