Skip to main content
KristiD5
Participating Frequently
May 7, 2019
Answered

Trying to use conditional formatting to change text color based on field contents.

  • May 7, 2019
  • 1 reply
  • 841 views

New(ish) to creating fillable forms in Acrobat Pro.  I would like to have the text within a field change color based on the numeric value entered.  Through other posts, I've learned that I have to enter a java script in the validation field.  As I'm unfamiliar with java script, I'm not able to use the examples in these other posts to help...I'm not sure what I need to change to do what I want to do.  The field is named "Percentage" and if the value entered is greater than 15, I want the text to appear in red.  Help???

This topic has been closed for replies.
Correct answer try67

As the custom validation script of the field you can enter this code:

event.target.textColor = (event.value>15) ? color.red : color.black;

I assume that you want the text color to be black if it's not more than 15...

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 7, 2019

As the custom validation script of the field you can enter this code:

event.target.textColor = (event.value>15) ? color.red : color.black;

I assume that you want the text color to be black if it's not more than 15...

KristiD5
KristiD5Author
Participating Frequently
May 7, 2019

Thanks!!  That worked perfectly!