Skip to main content
Participating Frequently
September 15, 2022
Question

Hide $0.00 Field Total on Print

  • September 15, 2022
  • 1 reply
  • 1555 views

I am having trouble getting the total field to not show on print so the user can fill the form out manually without having to cross it out. I've tried a couple of the custom validation scripts suggested in these boards but still cannot get it to work.

I've tried:

if (event.value==0) event.value = "";

And this:

var fields = ["Stipend", "Meal per diem", "Mileage total"];

var allEmpty = true;

var total = 0;

for (var i in fields) {

    var f = this.getField(fields);

    if (f.valueAsString!="Off") {

        total+=Number(f.valueAsString);

        allEmpty = false;

    }

}

if (allEmpty) event.value = "";

else event.value = total;

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 15, 2022

The first code should have worked. Where did you place it?

 

Participating Frequently
September 15, 2022

In the properties under the validate tab, custom validation script. 

try67
Community Expert
Community Expert
September 16, 2022

That should work. Can you share the file?