These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

May I have a little help thanks.

dtimes3
Registered: Sep 25 2008
Posts: 2

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!

My Product Information:
Acrobat Pro Extended 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You need to access the values of the fields:

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