Expand my Community achievements bar.

Is there a way to change the font color in the drop donw-list field when the user selects word.

Avatar

Level 2

Help me, please!
I must select the drop donw -list the word and change the font color when the user selects . For example , if the user selects word Disapproved change font color to red , select Approved changes color to green.

2 Replies

Avatar

Former Community Member

Good afternoon,

Try the following:-

if ($.boundItem(xfa.event.newText) == "Disapproved") {

  if (xfa.host.version < 8) {

  this.resolveNode("$").fontColor = "255, 0, 0";

 

  else {

  var CaptionColorBackup = this.resolveNode("$").caption.font.fill.color.value;

  this.resolveNode("$").font.fill.color.value = "255, 0, 0";

  this.resolveNode("$").caption.font.fill.color.value = CaptionColorBackup;

  

if ($.boundItem(xfa.event.newText) == "Approved") {

  if (xfa.host.version < 8) {

  this.resolveNode("$").fontColor = "0, 128, 0";

 

  else {

  var CaptionColorBackup = this.resolveNode("$").caption.font.fill.color.value;

  this.resolveNode("$").font.fill.color.value = "0, 128, 0";

  this.resolveNode("$").caption.font.fill.color.value = CaptionColorBackup;