Hi everybody, is it possible create a field where you can choose the color of background, like a drop-down list having different colors instead texts.
Other possibilities are allowed.
Thanks a lot
Views
Replies
Total Likes
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,
Views
Replies
Total Likes
Hi Varma LC,
do you have an example that can be downloaded?
Views
Replies
Total Likes