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

Learn more

View all

Sign in to view all badges

Need help changing fill color based on selection in livecycle

Level 1
Level 1

I have read and read every page i can find and i still cannot figure out a way to create a javascript for changing fill color in a form i create. I am not even sure where the javascipt goes but know i need one.

So i have a form that i would like to show customers what the shade looks like when they select is so they know exactly what they are getting. Seeing as there are so many variations of colors and i only offer a few.

The colors in the drop down are;





light pink


light blue


Clear (no fill)






If someone could explain to me exactly how to write this and where to put it that would be so great! I have to get this order form out in a few days. Or if there is a better easier way to do this please let me know

Thank you

1 Reply
Level 10
Level 10

Hi there,

Maybe a tool will help you get the colors that you wish to set for the field.

Use this tool online to get the RGB settings

Color Slider (RGB to hexidecimal converter)

Then you can use a switch statement in the exit or change event of your dropdown list which will set the color wanted on selection

Here is a sample/tutorial of a switch statement in JavaScript, you can also use normal if statements, it will end with the same result

JavaScript Switch Statement

To be able to set a color fill for a field, you can use any of these options in LiveCycle

Hope this will help ya!