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

FormCalc (If/Then)

KURGS
Registered: May 29 2008
Posts: 2

I am creating an expense reimbursement form. People using this form will either receive money or owe the institution money based on expenses incurred verses cash advanced/prepayments. The form has fields for calculating expenses and fields for calculating cash advances/prepayments; then there are fields "amount due to institution" and "amount due to employee."

I want to set the form up where if we owe the employee money it will calculate that amount in the "amount due to employee" field or if they owe us money it will calculate in the "amount due to institution" field.

I am a student worker with a summer job and completely new to Adobe Acrobat. I have no experience with or knowledge of Java. I have been able to create some easy calculations using FormCalc (ie number of miles driven * mileage rate, addition, subtraction, etc.); however, this has me stumped. I've look at the FormCalc manual and other postings online, but there is so much jargin that I can't make sense of it. Any help would be greatly appreciated! Also, if you anyone knows where I can find basic FormCalc formulas I would be very appreciative!

I work back and forth between Mac and PC.

My Product Information:
Acrobat Pro 8.1.2
bren1519
Registered: Apr 28 2008
Posts: 27
Hi......not an expert but after searching online I came up with the following for our expense claim and it works.

For balance due to firm calc:

var f = this.getField("ADVANCES")
var g = this.getField("SUBTOTAL")
event.value = f.value - g.value
var f = this.getField("BALANCE")
f.hidden = (event.value < 0)For balance due to employee:

var f = this.getField("SUBTOTAL")
var g = this.getField("ADVANCES")
event.value = f.value - g.value
var f = this.getField("TOTAL")
f.hidden = (event.value < 0)