Avatar

Level 6

Here is some simple solution may help you get what you need....

1. Add a text box and name it....ColorTxtField

2. Under Object>>Filed Pallet>>Appearance: select Custom...

3. Custom Appearance Pallet opens up for you to sepecify settings.... select "Background fill>>Style: Solid" and match the fill color to your template background.......................This is key step to get the following code working....

4. Add a dropdown with "Red, Green, Blue" as options to select

then in the change event of the dropdown use the following JS code try it out.

if

(xfa.event.change == "Red") this.parent.ColorTxtField.ui.textEdit.border.fill.color.value = "255,0,0";

if

(xfa.event.change == "Green") this.parent.ColorTxtField.ui.textEdit.border.fill.color.value = "0,255,0";

if

(xfa.event.change == "Blue") this.parent.ColorTxtField.ui.textEdit.border.fill.color.value = "0,0,255";

xfa.layout.relayout();

Now make changes as you needed.

Good luck,