Skip to main content
Participating Frequently
August 9, 2017
Answered

How to insert a drop down list of colors

  • August 9, 2017
  • 2 replies
  • 3307 views

I am needing to insert a drop down list to my PDF, but rather than a drop down selection of text, I want to fill the box with a particular color: green, yellow, or red. Is there a certain script I need to run or a certain tool for this in Adobe Acrobat?

This topic has been closed for replies.
Correct answer try67

Not possible with the built-in fields available in Acrobat. The only way I can think of implementing it is with a set of button fields and a custom-made script to show them when the main field is clicked, apply the selection to it when one of them is clicked, and then hide them. This is not a simple task, though.

2 replies

Participating Frequently
September 30, 2023

try this:  it worked for me

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

if(event.value == "red"){
f.textColor = color.red;
f.strokeColor = color.red;
f.fillColor = color.red}

else if(event.value == "yellow"){
f.textColor = color.yellow;
f.strokeColor = color.yellow;
f.fillColor = color.yellow}

else if(event.value == "green"){
f.textColor = color.green;
f.strokeColor = color.green;
f.fillColor = color.green}

else if(event.value == "white"){
f.textColor = color.white;
f.strokeColor = color.white;
f.fillColor = color.white}

try67
Community Expert
Community Expert
August 9, 2017

Do you mean that each item in the list has a unique color? If so, it's not

possible.

On Wed, Aug 9, 2017 at 9:44 PM, joshb21464502 <forums_noreply@adobe.com>

Participating Frequently
August 10, 2017

I have a blank cell on my pdf. All I need is to be able to either fill the cell with green, yellow, or red. There will not be any text in the cell, just want to be able to give an option to mark it green, yellow, or red as an easy indicator for projects. Exactly like this picture, except without text.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 10, 2017

Not possible with the built-in fields available in Acrobat. The only way I can think of implementing it is with a set of button fields and a custom-made script to show them when the main field is clicked, apply the selection to it when one of them is clicked, and then hide them. This is not a simple task, though.