• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

color code example not working

Explorer ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

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:

tempsnip.png

 

TOPICS
Acrobat SDK and JavaScript

Views

313

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

In the second line use

f.textColor = ...

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

Yes, it's a mistake in the documentation.

 

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

I tried in both validate and calculation. When I input code and enter positive value color is black,when input negative color is red but when then go to positive again it stays red.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

LATEST

Keep in mind it will only update after you leave the field, as that's when the value is "applied".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines