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

Caculating using javascript

image48
Registered: Dec 3 2008
Posts: 3
Answered

I don't know javascript which I guess I have to use to do subtraction. How do I subtract one field from another and populate the required result into a total field?

Maybe this is stupid but in my javascript window I just typed this:

Surplus_Deficit = Total Net Income - Total Expenses;

Those are my field names.

Any help would be appreciated.

My Product Information:
Acrobat Pro Extended 9.0, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
If you are using LiveCycle Designer:

FormCalc calculation:

TotalNetIncome - TotalExpenses;

JavaScript calculation:

$.rawValue = TotalNetIncome.rawValue - TotalExpenses.rawValue;

With Acrobat FormTool form JavaScript:

event.value = this.getField("Total Net Income").value - this.getField("Total Expenses").value

George Kaiser

image48
Registered: Dec 3 2008
Posts: 3
Thank You very much