On validate if statement with two conditionals.
In my form validation script I would like to have an if statement with two conditionals. I feel like the following script is formatted correctly but it is returning an error at the first if statement. Any insight as to why this is happening?
wordsList = input.MyField.toList(" ");
wordsCount = wordsList.size();
if(input.MyField2.contains("Some string about this long") && wordsCount > 150)
{
alert "Sorry. Only 150 words allowed for MyField2";
cancel submit;
}
else if
{ ... continue evaluating similar conditionals