Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help Javascript Array

Contributor ,
Feb 18, 2009 Feb 18, 2009
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
TOPICS
Getting started
720
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 22, 2009 Feb 22, 2009
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources