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

Refunded balance versus additional reimbursement on Expense Report Form

mjuarez
Registered: Dec 20 2010
Posts: 2
Answered

First-time form maker here. Is there a calculation or greater-than/less-than validation script I can write to make the TOTAL minus the LESS AMOUNT ADVANCED show up in either a REFUNDED BALANCE or ADDITIONAL REIMBURSEMENT box?
 
Right now, I am using the calculation of TOTAL - LESS AMOUNT ADVANCED to do the math. But the answer (regardless of whether it's positive or negative) currently defaults to my REFUNDED BALANCE box.
 
Here is the vertical placement of the boxes on my form:
 
TOTAL
LESS AMOUNT ADVANCED
REFUNDED BALANCE
ADDITIONAL REIMBURSEMENT
 
Thanks!
Mac

Mac

My Product Information:
Acrobat Pro 9.4, Macintosh
try67
Expert
Registered: Oct 30 2008
Posts: 2399
Accepted Answer
Use this code as the custom calculation script of REFUNDED BALANCE (hope I didn't get the two mixed up):

var amount = this.getField("TOTAL").value - this.getField("LESS AMOUNT ADVANCED").value;
if (amount<0) event.value = amount;
else event.value = "";


Use this code as the custom calculation script of ADDITIONAL REIMBURSEMENT:

var amount = this.getField("TOTAL").value - this.getField("LESS AMOUNT ADVANCED").value;
if (amount>0) event.value = amount;
else event.value = "";


- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

mjuarez
Registered: Dec 20 2010
Posts: 2
This appears to have been the fix.
Thank you very much for your quick reply! :)

Mac

Mac