Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Dropdown box selection to change background color of a different text field

New Here ,
Jun 17, 2021 Jun 17, 2021

Copy link to clipboard

Copied

Hello!

I have a client who likes to highlight rows on his to do list based on a certain type of task. Each type of task is a different color.

 

I would like to be able to create a dropdown with different color names in it and when a color is chosen, that row is highlighted in that color. I know how to do it with a button in the Indesign interactive PDF, but that makes the pdf too cluttered. My google-fu is failing me on how to do it with a dropdown list instead.

 

I have added a screenshot to show you what I have so far with the buttons.

I have the most recent version of Adobe Acrobat Pro.

 

I found this post on the forums but it doesn't explain how to change the color of a DIFFERENT field. Capture.JPG

TOPICS
PDF forms

Views

187

Likes

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
Adobe Community Professional ,
Jun 17, 2021 Jun 17, 2021

Copy link to clipboard

Copied

LATEST

Here is sample code you can work from, use it in "Dropdown" field validation script and in "Dropdown" field properties under 'options' tab check ' commit selected value immediately'.
You can adapt code to reset colors if needed and also you can use RGB colors since built in object have only few colors at disposal.

if(event.value == "Blue"){
this.getField("Row1.Field1").fillColor = color.blue;
this.getField("Row1.Field2").fillColor = color.blue;
this.getField("Row1.Field3").fillColor = color.blue;}
else if(event.value == "Yellow"){
this.getField("Row2.Field1").fillColor = color.yellow;
this.getField("Row2.Field2").fillColor = color.yellow;
this.getField("Row2.Field3").fillColor = color.yellow;}
else if(event.value == "Green"){
this.getField("Row3.Field1").fillColor = color.green;
this.getField("Row3.Field2").fillColor = color.green;
this.getField("Row3.Field3").fillColor = color.green;}

Likes

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