I don't know if I should post this here or in the javascript forum, but here goes.
<cfquery name="getcounty" datasource="stewardship">
SELECT distinct loc,coname
FROM org
WHERE left(loc,1) = '2' AND right(loc,2) <> '00' AND right
(loc,2) <> '99'
AND loc <> '2683'
ORDER BY coname
</cfquery>
<script language="javascript">
<CFINCLUDE template='/cfide/scripts/wddx.js'>
<cfwddx action='CFML2JS' input=#getcounty# toplevelvariable='q'>
var nRows= q.getRowCount();
var countyArray = new Array();
for (i=0;i < nRows; i++){
countyArray = new Array(2);}
for (i=0;i<nRows;i++){
countyArray[0] = q.getField(i,'loc');
countyArray[1] = q.getField(i,'coname');
}
</script>
<cfform name="test" action="wddxaction.cfm" method="post">
<cfinput type="text" name="location" validate="integer" size="4" maxlength="4">
<cfinput type="text" name="view" size="20" maxlength="20" readonly></cfform>
This is the code I am using to put location codes and county names into a javascript array. I want to put an onBlur event into the textbox named location that will put the county name that matches the location code into the text box called view. How do I need to tell it to do that or is there a better way? BTW, previous posts in this forum helped me get this far. Thanks to everyone who contributes to help people like me!
mkyzar
<cfquery name="getcounty" datasource="stewardship">
SELECT distinct loc,coname
FROM org
WHERE left(loc,1) = '2' AND right(loc,2) <> '00' AND right
(loc,2) <> '99'
AND loc <> '2683'
ORDER BY coname
</cfquery>
<script language="javascript">
<CFINCLUDE template='/cfide/scripts/wddx.js'>
<cfwddx action='CFML2JS' input=#getcounty# toplevelvariable='q'>
var nRows= q.getRowCount();
var countyArray = new Array();
for (i=0;i < nRows; i++){
countyArray = new Array(2);}
for (i=0;i<nRows;i++){
countyArray[0] = q.getField(i,'loc');
countyArray[1] = q.getField(i,'coname');
}
</script>
<cfform name="test" action="wddxaction.cfm" method="post">
<cfinput type="text" name="location" validate="integer" size="4" maxlength="4">
<cfinput type="text" name="view" size="20" maxlength="20" readonly></cfform>
This is the code I am using to put location codes and county names into a javascript array. I want to put an onBlur event into the textbox named location that will put the county name that matches the location code into the text box called view. How do I need to tell it to do that or is there a better way? BTW, previous posts in this forum helped me get this far. Thanks to everyone who contributes to help people like me!
mkyzar