I am trying to pass an array into a function. The function is:
function colorText(myArray,compsLen,myVal){
var col = “FFFFCC”;
var col2 = “FFFFFF”;
for (i=0;i<compsLen;i++){
if (myVal == 1){
document.PAFform.[myArray[i]].style.backgroundColor = col;
}else{
document.PAFform.[myArray[i]].style.backgroundColor = col2;
}
}
}
I’m trying to call it as follows:
colorText(comps,compsLen,myVal);
On the call I get the following error:
missing name after . operator
using the javascript: debugger in firefox the arrow points at the space between the [ and myArray. I’ve been trying different ways to call it to no avail. Any help is appreciated.
Thanks.
Mark