Avatar

Level 10

Hi,

You can change the background colour at runtime with this script in the exit event:

var vName = this.somExpression;

var fieldObj = xfa.resolveNode(vName + ".ui.#choiceList.border.fill.color");


if (this.rawValue == "January") {

     fieldObj.value = "255,255,225";

}

else if (this.rawValue == "February") {

     fieldObj.value = "255,225,225";

}

else if (this.rawValue == "March") {

     fieldObj.value = "225,225,255";

}

else {

     fieldObj.value = "255,255,255";

}

/* Check the type of object and change the .ui reference:

     Date field =      #dateTimeEdit 

     Dropdown =      #choiceList 

     Checkbox =      #checkButton 

     Text field =      #textEdit 

     Numeric field =     #numericEdit

See example here: https://acrobat.com/#d=WzvhgBC6FEwnr5DgSgVdlA

Good luck,

Niall