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
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