Hi everyone, I'm pretty new to javascript and I have got myself a bit stuck on a simple calculation in Acrobat 9 Pro Extended.
I have 4 text fields, called "Text2A", "Text3A", "Text30" and "Text4A".
And this is what im trying to do with them, "=IF(D9="Y",SUM(E9-T11),0)"
So this is if text field Text2A = "Y"
Then text field Text4A = Text3A - Text30
if not then set Text4A to 0.
Here is the code I have at the moment:
var correct = this.getField("Text2A");
var holidayPay = this.getField("Text3A");
var lowerEearnings = this.getField("Text30");
if (correct == "Y")
event.value = holidayPay - LowerEearnings
else
event.value = 0;
Where am I going wrong, I know I cant be far off, well at least I hope I'm not. This code is in text field Text4A. Thank you in advance for any help given!
var correct = this.getField("Text2A").value;
var holidayPay = this.getField("Text3A").value;
var lowerEearnings = this.getField("Text30").value;
if (correct == "Y") {
event.value = holidayPay - LowerEearnings;
} else {
event.value = 0;
}
George