Expand my Community achievements bar.

Stopping a total from displaying a zero until there is something to total

Avatar

Level 10
I'm using the script below for totalling some fields. When the fields to total are empty, the total field displays a zero. I'd like to stop it from displaying the zero.



var fields = xfa.resolveNodes("ApplicantTotalGross[*]");

var total = 0;

for (var i=0; i <= fields.length-1; i++) {

total = total + fields.item(i).rawValue;

}

this.rawValue = total;
4 Replies

Avatar

Former Community Member
In the Pattern/Display tab on the Object palette for the field there is a checkbox that allows you to define how you want to display zero values. You will want to check the allow empty option.

Avatar

Level 10
Thanks!



I knew I'd seen it somewhere but couldn't track it down...

Avatar

Former Community Member
I think this might help me with a form to hide 0 values from being visible.. but can you tell me if it is for Adobe Livecycle? I do not recognize the script. If it is for Livecycle would it go in the Calculate area?



LaTarsha

Avatar

Level 10
The script is javascript for Livecycle.



But the fix for displaying the zero or not is what Paul posted - except it was actually the "Allow Zero" checkbox that did the trick.