Specs: running LiveCycle Designer 8
setting an expression statement to a numeric field
if (NDays<=2) then
(NCost/2)*NDays
else if (NDays>2) then
(NDays-2)*NCost+NCost
endif
NDays and NCost are two other user entered fields.
I put this statement in the calculate event with Formcalc as the language and Client as the run at. The goal here is for the user to enter a cost per day and how many days their trip is, and for this if statement to automatically calculate the total. The formula is supposed to represent the fact that the first and last days of a trip, you recieve half of the usual allotment.
Ok, now with all this set. When I open the saved form with reader or pro, i get a "syntax error near token endif on line 5, column 5" and I have no idea why. I am wondering why this script is running at initialize if it is set in the calculate event....
any help would be apreciated!