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

Subtracting in Acrobat9

lsoto
Registered: Nov 2 2010
Posts: 1

I am new to Javascript and need help regarding subtraction in Acrobat9 Pro. Field 1 is a sum of previous fields; I will subtract Field2, Field3, Field4, and Field5 sequentially into an event “Amount Due or Remittance”.
 
var a = this.getField("SubTotalAll").value; // variable for the estimated value
var b = this.getField("LessTravel").value; // variable for the actual value
var c = this.getField("LessRegistration").value; // variable for the actual value
var d = this.getField("LessPcard").value; // variable for the actual value
var e = this.getField("LessTravelAdvances").value; // variable for the actual value
event.value = a - b - c - d - e; // compute difference of the two values

My Product Information:
Acrobat Pro 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
What is the specific question?

Are you getting any error messages in the JavaScript debugging console?

Make sure your field names are spelled exactly and capitalized exactly as the field is named in the form. You might want to look at How to do (not so simple) form calculations by Thom Parker.

George Kaiser