Spent the better part of the day trying to figure this out. Searched and searched the forums still stumped. If I comment out the line with "toTitleCase" in it validation passes and it works fine.
I've tried all kinds of variations on the name to no avail.
Error when validating scrpt... In an OnRecordStart rule.
TypeError:Field("RegTypeB").toTitleCase is not a function
Thanks so much for any help with this it's driving me crazy. (short drive that it is)
if (Field("RegTypeB") == "Government for the people")
{
// statements to perform if
// expression is true
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toUpperCase());
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toLowerCase());
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toTitleCase());
var botBar = FindTextFrame("botBar");
botBar.suppress = false;
}
else if (Field("RegTypeB") == "Sponsor")
{
// statements to perform if
// expression is true
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toUpperCase());
var botBar = FindTextFrame("botBar");
botBar.suppress = false;
}
else if (Field("RegTypeB") == "Staff")
{
// statements to perform if
// expression is true
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toUpperCase());
var botBar = FindTextFrame("botBar");
botBar.suppress = false;
}
else if (Field("RegTypeB") == "Press")
{
// statements to perform if
// expression is true
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toUpperCase());
var botBar = FindTextFrame("botBar");
botBar.suppress = false;
}
else if (Field("RegTypeB") == "Industry")
{
// statements to perform if
// expression is true
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toUpperCase());
var botBar = FindTextFrame("botBar");
botBar.suppress = true;
}
else
{
// statements to perform if
// none of the above expressions is true
FusionPro.Composition.AddVariable("RegTypeB", Field("RegTypeB").toUpperCase());
var botBar = FindTextFrame("botBar");
botBar.suppress = true;
}