Mr. Moduswrote:
From what I can tell from your loop you aren't actually looping
through the result set, just running a loop as large as the record
count.
I thought so, too. But then, Botman63 says, "The array is
populated just fine ". There's nothing wrong with his code. So long
as what he wants is that all the elements of arrayData should have
the same value. However, your remark -- decrement to adjust to
array indices in JS -- makes me now think that that might not be
what Botman63 wanted.
Try this and let me know if it's the fix.
<cfoutput query="qCompanyClientNames">
arrayData[#DecrementValue(CurrentRow)#] =
'#CoName#|[#CoName#] #ClName#|'
</cfoutput>
Here's another suggestion, based on Botman63's own code. It
simply adds the indices x+1.
<cfset Records = #qCompanyClientNames.RecordCount# - 1>
var arrayData = new Array();
<cfoutput>
<cfloop from=0 to=#Records# index=x>
arrayData[#x#] =
'#qCompanyClientNames.CoName[x+1]#|[#qCompanyClientNames.CoName[x+1]#]
#qCompanyClientNames.ClName[x+1]#|'
</cfloop>
</cfoutput>