Expand my Community achievements bar.

Need help changing fill color based on selection in livecycle

Avatar

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;

Black

Maroon

Red

Pink

light pink

Blue

light blue

purple

Clear (no fill)

white

orange

yellow

green

beige

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

Avatar

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

http://forms.stefcameron.com/2008/03/14/field-background-color-fill/

Hope this will help ya!