Copy link to clipboard
Copied
I have a pdf that contains three fields. One is a text field in which dollar amount is entered, the second is a text field in which a term is entered (i.e., 36, 48, 60) and the last field is the one in which the solved amount will be listed. An example of this formula is if Cost of Licenses >$25,000; multiple the entered amount * .03081 if FinanceTerm = 36.
I'm getting the following error message: SyntaxError: syntax error 6: at line 7. I'm very new to multiple options and can't figure out what I'm missing. Any help is appreciated.
var A = this.getField("CostofLicenses").value; // the value of field A;
var B = this.getField("FinanceTerm").value; // the value of field B;
var C = this.getField("MonthlyPayment").value; // the value of field C;
event.value = "";
if(A>$24,999,B=="36"){event.value=A*.03081};
else if(A<$25,000,B=="36"){event.value=A*.03110};
else if(A>$24,999,B=="48"){event.value=A*.02383};
else if(A<$25,000,B=="48"){event.value=A*.02386};
else if(A>$24,999,B=="60"){event.value=A*.01962};
else if(A<$25,000,B=="60"){event.value=A*.01972};
Remove the ; after }
Copy link to clipboard
Copied
if(A>$24,999,B=="36")
just isn't right. You use && or || according to the condition you want.
Copy link to clipboard
Copied
Also, remove the "$" symbol and the commas from the numbers.
Copy link to clipboard
Copied
Thank you. I initially and the && and changed it to a comma after watching a video on line.
Get Outlook for iOS<https://aka.ms/o0ukef>
Copy link to clipboard
Copied
I updated the recommended changes and am now getting a syntax error 6 at line 7
else if(A>24999 && B=="48"){event.value=A*.02383}; - am I missing a space in there?
I appreciate the help.
var A = this.getField("CostofLicenses").value; // the value of field A;
var B = this.getField("FinanceTerm").value; // the value of field B;
var C = this.getField("MonthlyPayment").value; // the value of field C;
event.value = "";
if(A>24999 && B=="36"){event.value=A*.03081};
else if(A<25000 && B=="36"){event.value=A*.03110};
else if(A>24999 && B=="48"){event.value=A*.02383};
else if(A<25000 && B=="48"){event.value=A*.02386};
else if(A>24999 && B=="60"){event.value=A*.01962};
else if(A<25000 && B=="60"){event.value=A*.01972};
Copy link to clipboard
Copied
Remove the ; after }