Dropdown value isn't giving current selection
I am trying to write a script to change a dropdown's background color depending on the value selected. I have "Commit selected value immediately" selected and my code, which is attached to Validate is here:
var drop = this.getField("Dropdown1");
var DropDownValue = event.value;
DropDownValue = drop.value;
console.println(DropDownValue);
if (DropDownValue == "Pass"){
DropDown.fillColor = color.green;
}else if(DropDownValue == "Fail"){
DropDown.fillColor = color.red;
}else{
DropDown.fillColor = color.white;
}
The problem I am having is when I select "Pass" it doesn't change, but when I select "Fail", "Pass" gets written to the console and the dropdown turns green as if I selected "Pass". Then when I select "Pass" again "Fail" gets written to the console and it turns red. Basically Adobe thinks the prior selection is the current one. How can I fix this behavior?
