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

Conditional Formatting on Interactive PDF Drop-Down Text Field

New Here ,
May 08, 2024 May 08, 2024

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.pngexpand image

 

TOPICS
PDF forms
833
Translate
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
1 ACCEPTED SOLUTION
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;

View solution in original post

Translate
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 ,
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;

Translate
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
New Here ,
May 29, 2024 May 29, 2024
LATEST

I'm converted my interatcive PDG into a Form.

 

Using a "submit" button, I have added in the following actions upon a Mouse-Up click of the button.

1) Run JavaScript
2) Submit a form (mailto:) 

 

The following is what I have listed as the script but it doesn't seem to be working. What am I doing wrong? Any advice?

var f = this.getField("Budget Status");

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;

var f = this.getField("Design Status");

if (event.value=="Either client is happy with the design & team is not, or team is happy with design & client is not.") f.textColor = color.yellow;

else if (event.value=="Client is happy with design & team is proud of the design.") f.textColor = color.green;

else if (event.value=="Neither team nor client are happy with design.") f.textColor = color.red;

else f.textColor = color.black;

var f = this.getField("Craft Status");

if (event.value=="Team is proud of the quality of the diagrams and/or drawings issued/to be issued.") f.textColor = color.green;

else if (event.value=="Team is not happy of the quality of the diagrams and/or drawings issued/to be issued.") f.textColor = color.red;

else if (event.value=="There is room for improvement on the quality of the diagrams and/or drawings issued/to be issued.") f.textColor = color.yellow;

else f.textColor = color.black;

var f = this.getField("Schedule Status");

if (event.value=="Project is tracking with distributed design & documentation schedule.") f.textColor = color.green;

else if (event.value=="A project design schedule has not been distributed.") f.textColor = color.red;

else if (event.value=="Project is slipping from distributed design & documentation schedule - update required.") f.textColor = color.yellow;

else f.textColor = color.black;

Translate
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