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

Stop a calculation box showing a value of 0.00 on print-out

QwertyKid
Registered: Nov 28 2010
Posts: 14
Answered

I have come across an issue with using a read only text box containing a calculation, the text box contains a sub-total i.e. quantity x price. How do I stop it showing a value of 0.00 if there is no sum to calculate as it will cause problems if people want to print out the form to write on it in order that they can fax it instead of using the online Submit Form?
 
If the value is not 0.00 we need whatever the calculated value is to be on the printed form along with other content as the form may contain credit card information that they would only be happy with faxing as opposed to an unsecure email.
 

...just when you think you have it idiot proof ...along comes a bigger idiot

#:O)

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Why not change the calculation script to set the field to null when the result is zero?

George Kaiser

QwertyKid
Registered: Nov 28 2010
Posts: 14
That sounds like the perfect answer, excuse my ignorance I'm on day 3 of using the software. Care to explain how to do that?

...just when you think you have it idiot proof ...along comes a bigger idiot

#:O)

QwertyKid
Registered: Nov 28 2010
Posts: 14
Accepted Answer
OK got it from a previous post; I used this

if ((event.value == 0) && (getField("Q1.0").valueAsString === "")) event.value = "";
As a custom validate script, where Q1.0 (quantity) equals nothing, it doesn't print the 0.00 in the sub-total box.


I also setup a hidden cell called NULL to do the same for the TAX and TOTAL boxes.

if ((event.value == 0) && (getField("NULL").valueAsString === "")) event.value = "";
NOTE: This information relates to Acrobat X Pro, not LifeCycle Designer.

...just when you think you have it idiot proof ...along comes a bigger idiot

#:O)