Hi Darren,
To achieve this in a checkbox (hazard1), I set up an invisible textfield with the following javascript in the calculate event:
var fld1 = xfa.resolveNode("form1.p4c.hazard1.ui.#checkButton.border.fill.color");
if (hazard1.rawValue == 1) {
fld1.value = "225,255,225";
}
else {
fld1.value = "255,225,225";
}
The reasons we had an invisible textfield is that we wanted to assess a group of checkboxes and if any of them were checked then they all turned green.
For the dropdown list (scaff_inspected) with specified values we used the following javascript in the validate event:
var fld;
fld = xfa.resolveNode("form1.p1.scaff_inspected.ui.#choiceList.border.fill.color");
if (this.rawValue >= 1 ) {
fld.value = "225,255,225";
}
else {
fld.value = "255,225,225";
}
It appears that you can access the fill colour using the .ui appraoch, note that you need to correct notation for the field you are using, for example:
Date field = .ui.#dateTimeEdit
Dropdown = .ui.#choiceList
Checkbox = .ui#checkButton
Text field = .ui#textEdit
Numeric field = .ui.#numericEdit
Hope that works for you,
Niall