Hello Everyone,
I am creating an interactive invoice in Acrobat 9 and have a bit of a problem with one of the number fields. I have it set so that the user can enter the quantity and the cost/item and have it calculate the total, which is fine in the fields that have this information. The problem is when the quantity and cost/items fields are empty, the total column lists a 0. I would like that field to be blank.
How do I make this happen?
http://acrobatusers.com/tutorials/2006/formatting_text_fields
In your case the code will need to format for two conditions, the dollar amount and blank. The easiest condition to test for is a 0 calculation result, but you could also detect blank input values as well. Here's an example Format Script
if(event.value == 0)
event.value = "";
else
event.value = util.printf("$%,02.2f",event.value);
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script