Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How to Set a Drop down of color choices to color fill a text field in RunTime

teppytep
Level 1
Level 1

Hi Guys,

I am working on a pdf file and I want the users who will fill up my form to be able to change the text field to any color that they want during runtime. I already have a code, however I would want to add two things:

1. change the yellow to a lighter color of yellow.

2. Add color orange

Here is the code that I got, that I hope you could help me revise for me to achieve it.

var colors = new Array();

for (var i in color)
  colors.push(i); // get a list of colors

while (colors[0] != 'transparent')
  colors.shift();  // bump the non-colors

colors.unshift('Choose a Color:'); // label

var choice = app.popUpMenu(colors); // show menu

if (choice != null) // did user select something?
   this.getField('Label 1').fillColor = eval('color.' + choice);

Thanks, guysss!

0 Replies