Expand my Community achievements bar.

SOLVED

Hiding null fields except when calculated to show 0% - LiveCycle ES3

Avatar

Level 2

I have a form that I am working on that does a calculation regarding lending. It will take the user inputted monthly salary and the total unsecured debt to produce a %. Well I have it currently to show up as blank until both fields are non zero. If I have the unsecured field with a 0 it will not calculate the calculation at all leaving the field blank. I need it to show up as a 0% if the total unsecured is actually $0. EXAMPLE:

Capture.JPG

As you can see on the right side I have 2 different calculation running for a Primary Borrower and a Co-Signer. Under Total Unsec$ The first is 12,000 and the second is 0$. Then under the % Unsec to Inc it shows 13% and then blank. I need the blank field to populate a 0%.

This is currently what my scripting looks like in that field.

if

(AINC1 <> 0 and AINC1.isNull == 0) then

;

And both the Allow Empty and Allow Zero boxes are checked under Patterns... in the object tab. 

THANKS FOR YOUR HELP!!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Um...

the patterns where just examples to explain, what they can be used for.

If you what your blank field to display 0% then use the display pattern null{'0 %'}.

The string within the quotes then will be displayed in the field if the fiels value actually is null.

To hide the 0 % when printing the form you need scripting.

In the prePrint event enter the script

$.format.picture.value = ""

and in the postPrint event

$.format.picture.value = "null{'0 %'}|zero{'0 %'}|num{zz9 '%'}"

View solution in original post

3 Replies

Avatar

Level 10

Hi,

you can use null and zero patterns in you display pattern to display almost everything in the numeric field if the calculated value is 0 or null.

Display pattern:     null{'0 %'}|zero{'0 %'}|num{zz9 '%'}                    Displays 0% when calculation is 0 or null

Display pattern:     null{'0 %'}|zero{'unknown'}|num{zz9 '%'}           Displays 0% when calculation is 0 and 'unknown' when null

Avatar

Level 2

This is only semi helpful... instead of my field being black with those display patterns it actually makes it so the field populates a 0% instead of hididing it. The second one actually has the field say 'unknown' which is no help.

To clarify a little. The form should always be blank if someone wants to print it thus hiding the 0%. However, I want the %Unsec to Inc field to show a 0% if Total Unsec $ actually has a $0 entered by the user. As it stands, I can enter .1$ and it will turn it to 0$ and then 0% below but that means the user has to know to enter it like that making it not user friendly....

Avatar

Correct answer by
Level 10

Um...

the patterns where just examples to explain, what they can be used for.

If you what your blank field to display 0% then use the display pattern null{'0 %'}.

The string within the quotes then will be displayed in the field if the fiels value actually is null.

To hide the 0 % when printing the form you need scripting.

In the prePrint event enter the script

$.format.picture.value = ""

and in the postPrint event

$.format.picture.value = "null{'0 %'}|zero{'0 %'}|num{zz9 '%'}"