Changing background color based on array
Hello, what I'm trying to do is change the background color of text fields based on a number in an array that matches with the name of the text field in my pdf. The numbers are 0 to 100. So if it is the number 0, it matches with one of the array elements then colors the background based on the first element. Here is the code I'm working on and I can't seem to get it to change the color, any advice on what I could do to make it work?
Thanks
Brian
var colors = [
['blue', 99,98,95,94,91,90,89,80,29,20,19,18,13,12,11,10,9,8,5,4,3,2,1,0],
['green', 25,17,16,15,7,6],
['brown', 24,14],
['red', ],
];
for (var x = 0; x < 100; x ++)
{
for (var i = 0; i < colors.length; i++){
for (var j = 0; j< 100; j++){
if (colors[i][j] = x){
getField(getNthFieldName(x)).fillColor = color.colors[i][0];
}
}
}
}