Skip to main content
Inspiring
February 18, 2009
Question

Help Javascript Array

  • February 18, 2009
  • 1 reply
  • 761 views
I am trying to validate an input field onkeyUp ie. to make sure value is not in the DB already. See below Code.

I am getting error Object expected. What am I missing here. The Array I can see is populated with records from the cfquery. See Code below
This topic has been closed for replies.

1 reply

Inspiring
February 22, 2009
First thing is that js array index starts from zero while cf starts from one.
I think you have created an array of arrays.

So, I think the following code

<cfoutput query="qryAllindicators">
myDesc[#qryAllindicators.CURRENTROW#]= new Array()
myDesc[#qryAllindicators.CURRENTROW#][#qryAllindicators.CURRENTROW#] = "#qryAllindicators.INDICATORDESC#"
</cfoutput>

Should be changed to

<cfoutput query="qryAllindicators">
myDesc[#qryAllindicators.CURRENTROW# - 1] = "#qryAllindicators.INDICATORDESC#"
</cfoutput>

Ken