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

Text Field Calculations

DHeinz
Registered: Dec 8 2008
Posts: 10

Is there any way to calculate the difference between two text fields?

My Product Information:
Acrobat Pro 7.0, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Yes, you can use substrigs to compare each letter of each string. The exact syntax will depend upon if the form is an Acrobat Form or LiveCycle Designer form and if LiveCycle Designer which scripting language.

George Kaiser

DHeinz
Registered: Dec 8 2008
Posts: 10
I am using an ADOBE Acrobat Form. And am trying to subtract two fields, "Total Assets" from "Total Liabilities."
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You need to set the format for the fields to "Number"

And then for "Total Equity" field you can use the following "Custom calculation script":

event.value = this.getField("Total Assets").value - this.getField("Total Liabilities").value;

There are a number of eSeminars on demand and articles about using Acrobat Forms and JavaScript that can help you learn how to perform various tasks in JavaScript.

George Kaiser

DHeinz
Registered: Dec 8 2008
Posts: 10
So I'm assuming that if I had multiple text fileds that I wanted to subtract from one field in particular the formula would be:

event.value = this.getField("I").value - this.getField("J").value- this.getField("K").value- this.getField("L").value- this.getField("0").value;