Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array Question

Status
Not open for further replies.

mkyzar

Programmer
Joined
Oct 19, 2000
Messages
56
Location
US
I don't know if I should post this here or in the javascript forum, but here goes.

<cfquery name=&quot;getcounty&quot; datasource=&quot;stewardship&quot;>
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=&quot;javascript&quot;>
<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=&quot;test&quot; action=&quot;wddxaction.cfm&quot; method=&quot;post&quot;>
<cfinput type=&quot;text&quot; name=&quot;location&quot; validate=&quot;integer&quot; size=&quot;4&quot; maxlength=&quot;4&quot;>
<cfinput type=&quot;text&quot; name=&quot;view&quot; size=&quot;20&quot; maxlength=&quot;20&quot; 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top