Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Eliminating Zeros

Avatar

Level 4

I have Adobe X Pro and I have created a form in Adobe LiveCycle Designer.  I am building in some calculations and each calculation is predicated on some numbered data entered in a previous field.  For example, CR2 = FR2 + CR1, and CR3 = FR3 + CR2 and so on.  I am using Javascripts for the calculations.  I am wondering if there is a way to hide zeros in all the rest of the fields if there is no number in FR2 or some other calculated field.  I know that in Adobe Acrobat there is a Javascript that can be used to hide zeros, but I have not found one to use in the Javascript in Adobe LiveCycle Designer. Does anyone know of this?

Thanks for your time.

Connie

1 Accepted Solution

Avatar

Correct answer by
Level 5

Why not in your calculation check for null in FR2 for example, then your run your calc if its not and set the field to null when FR2 is null. Something like

if ( ! FR2.isNull )

{

    $.rawValue = FR2.rawValue + CR1.rawValue;

}

else

{

    $.rawValue = null;

}

which would set the result field to empty rather than a zero. Setting a fields raw value to null, would basically be saying it has no value at the moment

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

Why not in your calculation check for null in FR2 for example, then your run your calc if its not and set the field to null when FR2 is null. Something like

if ( ! FR2.isNull )

{

    $.rawValue = FR2.rawValue + CR1.rawValue;

}

else

{

    $.rawValue = null;

}

which would set the result field to empty rather than a zero. Setting a fields raw value to null, would basically be saying it has no value at the moment

Avatar

Level 4

This worked beautifully - thank you very much.