This doesn't seem to be working... I am trying to send an array to my jscript, but am having problems. I query my db, populate the array (which is working), convert using wddx and try to get the length when my input changes (this is what is not working) - please help!!! Code is as follows:
[CODE=cfm]<head>
<cfquery datasource="xxx x" name="get_dates ">
select * from wwa_cycles where active_cycle = 1
</cfquery>
<!--Create/Populate the array-->
<cfset WWAverageArray = ArrayNew(2)>
<!--Adding the results to the array-->
<cfif #get_dates.reco rdcount# neq 0 >
<cfloop query="get_date s">
<cfset WWAverageArray[CurrentRow][1] = cycle>
<cfset WWAverageArray[CurrentRow][2] = begin_wwa_month >
<cfset WWAverageArray[CurrentRow][3] = end_wwa_month>
<cfset WWAverageArray[CurrentRow][4] = days_in_month_1 >
</cfloop>
</cfif>
<!---cfdump var="#WWAverage Array#"--->
[/CODE]
[HTML]<SCRIPT LANGUAGE="javas cript" TYPE="text/javascript">
function get_read_dates( in_cycle){
<CFWDDX action="CFML2JS " input="#WWAvera geArray#" toplevelvariabl e="jsAvgArray " output="jsArray ">
<cfoutput>#jsAv gArray#</cfoutput>
alert(jsAvgArra y.length);
}
</SCRIPT>
</head>
<body>
<form action="wwavera ge_calculator.c fm" method="post" name="thisform" >
<input type="text" name="meter_rea d_cycle" size="5" maxlength="2" onChange="get_r ead_dates(this. value)"/>
</form>[/HTML]
[CODE=cfm]<head>
<cfquery datasource="xxx x" name="get_dates ">
select * from wwa_cycles where active_cycle = 1
</cfquery>
<!--Create/Populate the array-->
<cfset WWAverageArray = ArrayNew(2)>
<!--Adding the results to the array-->
<cfif #get_dates.reco rdcount# neq 0 >
<cfloop query="get_date s">
<cfset WWAverageArray[CurrentRow][1] = cycle>
<cfset WWAverageArray[CurrentRow][2] = begin_wwa_month >
<cfset WWAverageArray[CurrentRow][3] = end_wwa_month>
<cfset WWAverageArray[CurrentRow][4] = days_in_month_1 >
</cfloop>
</cfif>
<!---cfdump var="#WWAverage Array#"--->
[/CODE]
[HTML]<SCRIPT LANGUAGE="javas cript" TYPE="text/javascript">
function get_read_dates( in_cycle){
<CFWDDX action="CFML2JS " input="#WWAvera geArray#" toplevelvariabl e="jsAvgArray " output="jsArray ">
<cfoutput>#jsAv gArray#</cfoutput>
alert(jsAvgArra y.length);
}
</SCRIPT>
</head>
<body>
<form action="wwavera ge_calculator.c fm" method="post" name="thisform" >
<input type="text" name="meter_rea d_cycle" size="5" maxlength="2" onChange="get_r ead_dates(this. value)"/>
</form>[/HTML]
Comment