I hadn't thought of using regex, but that may work as a great possiblity, thanks :) .
What I'm actually trying to do is look for a number within an array. The number is dynamically set as is the array. Indexof was working correctly, but then I realized my error.
Here is a snippet:
-
var dispCA = new Array(<cfoutput query="getCA">#id#<cfif getCA.currentRow LT getCA.recordCount>,</cfif></cfoutput>);
-
var dispSup = new Array(<cfoutput query="getSup">#id#<cfif getSup.currentRow LT getSup.recordCount>,</cfif></cfoutput>);
-
var contID = document.getElementsByName('contactID');
-
-
for(var i=0;i<contID.length;i++)
-
{
-
if(dispCA.join().indexOf(contID[i].value)>=0)
-
{
-
contID[i].checked = true;
-
}
-
else
-
{
-
contID[i].checked = false;
-
}
-
}
-
Thank you for your help!