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

Conditional Formatting on Interactive PDF Drop-Down Text Field

New Here ,
May 08, 2024 May 08, 2024

Copy link to clipboard

Copied

I'm hoping to apply conditional formatting on a fillable form which is an Interactive PDF file (designed in InDesign). Unfortunately, the Buttons and Forms window in InDesign only allows font type and font size to be changed for the drop-down, not color. 

Based on what drop-down option is selected, I want the final text to appear in that said color.  Is there a script or something I could apply? 

 

Nora372717720pyi_0-1715203598402.png

 

TOPICS
PDF forms

Views

58

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

correct answers 1 Correct answer

Community Expert , May 08, 2024 May 08, 2024

You can use something like this as the custom validation script of the drop-down:

var f = this.getField("Text1");

if (event.value=="YELLOW") f.textColor = color.yellow;

else if (event.value=="GREEN") f.textColor = color.green;

else if (event.value=="RED") f.textColor = color.red;

else f.textColor = color.black;

Votes

Translate

Translate
Community Expert ,
May 08, 2024 May 08, 2024

Copy link to clipboard

Copied

LATEST

You can use something like this as the custom validation script of the drop-down:

var f = this.getField("Text1");

if (event.value=="YELLOW") f.textColor = color.yellow;

else if (event.value=="GREEN") f.textColor = color.green;

else if (event.value=="RED") f.textColor = color.red;

else f.textColor = color.black;

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