Skip to main content
Participating Frequently
March 3, 2022
Question

Keep field empty if the product of two fields is equal to 0

  • March 3, 2022
  • 3 replies
  • 558 views

Hello,

How can I display nothing on a calculated field if the result is 0 or there is nothing to calculate because the other fields have not been filled?

Thank you.

This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
Community Expert
March 3, 2022

You should use this script as a "Custom Format Script" instead of a "Custom Validation Script" because the Format script only modifies the display in the field, it does not change its real value which is always zero and therefore remains usable for further calculations.

 

Acrobate du PDF, InDesigner et Photoshopographe
Nesa Nurani
Community Expert
Community Expert
March 3, 2022

As validation script of that field use this:

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

Participating Frequently
March 3, 2022

It's OK !

Thank you

Eric Dumas
Community Expert
Community Expert
March 3, 2022

Can you clarify?

At the moment you get an error or some indication that something is missing if the other fields are not completed?

That seems to be some scripting requirement.

Participating Frequently
March 3, 2022

if the other two fields are not filled, the calculated field displays 0 and I would like it to display nothing