I have a dropdown list in a pdf with a couple of numbers, i want the text to change color depending on what number is choosen (1-5). I have "Space, 1, 2, 3, 4, 5" because i want the list to be blank when nothing is choosen (space).
The code down below gives me the function i want but the sad part is that the list is white when (space) is choosen and if i remove "if (v == 0){ event.target.textColor = color.white;" then i get a 0 instead of a blank box (space)
any suggestions?
var v = Number(this.getField("Dropdown2.1.0").valueAsString) ;
if (v == 0){
event.target.textColor = color.white;
} else if (v < 4){
event.target.textColor = color.black;
} else if (v > 3){
event.target.textColor = color.red;
}
event.value = v;
The code down below gives me the function i want but the sad part is that the list is white when (space) is choosen and if i remove "if (v == 0){ event.target.textColor = color.white;" then i get a 0 instead of a blank box (space)
any suggestions?
var v = Number(this.getField("Dropdown2.1.0").valueAsString) ;
if (v == 0){
event.target.textColor = color.white;
} else if (v < 4){
event.target.textColor = color.black;
} else if (v > 3){
event.target.textColor = color.red;
}
event.value = v;