Skip to main content
Known Participant
August 23, 2020
Question

color code example not working

  • August 23, 2020
  • 1 reply
  • 731 views

I saw example in "JavaScript for Acrobat API Reference" to change text color depending on value, but I can't get it to work, I tried it in validation and in calculation but it doesn't work. What am I doing wrong? Here is code example:

 

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
August 23, 2020

In the second line use

f.textColor = ...

 

MarietaaAuthor
Known Participant
August 23, 2020

First let me just ask is that just typing error in "JavaScript for Acrobat API Reference"?

Your suggestion work but if value is negative color should be red right?

 

EDIT:sometimes if negative color is black if positive red, other times whatever value it's always red.

it's all mixed up, I just don't get it.

try67
Community Expert
Community Expert
August 23, 2020

Yes, it's a mistake in the documentation.

 

Where did you place the code, exactly? Under what event?