Copy link to clipboard
Copied
Googled this for several hours, hope I'm missing the obvious as usual...
I'm using CF9 and IIS7. Followed/tailored simple autosuggest code from Ben Forta.
Came up with HTML:
<cfinput type="text" name="Employer" size="50" autosuggest="cfc:employer.lookupEmployer({cfautosuggestvalue})">
and a CFC named employer.cfc in the current template folder:
<cfcomponent output="false">
<cffunction name="lookupEmployer" access="remote" returntype="array">
<cfargument name="search" type="any" required="false" default="">
<cfset var data="">
<cfset var result=ArrayNew(1)>
<cfquery name="data" datasource="Binkley">
Select lname
From tdLicense
Order By lname
</cfquery>
<cfloop query="data">
<cfset ArrayAppend(result, lname)>
</cfloop>
<cfreturn result>
</cffunction>
</cfcomponent>
The query runs fine in a test cfm file.
Any help appreciated.
Copy link to clipboard
Copied
Dan Bracuk wrote:
If your search is case sensitive, that would explain why you are not getting results.
I'm getting a response. I typed UCase in the form and got same response.: ["SMALL, EDWARD H ","SMALL, GEORGIA A ","SMALL, JENNIFER LEIGH","SMALL, JOHN PRESTON ","SMALL, JOHN WILLIAM "]
It just never shows up on the page
Copy link to clipboard
Copied
Strange. There is apparently a translation from C:\inetpub\wwwroot\ to C:\Workgroups\WebPages\. If that is indeed so, then this should work:
<cfinput type="text" name="Employerx" id="Employerx" size="50" autosuggest="cfc:/binkley/TrackData/NoMenu/employers.lookupEmployer({cfautosuggestvalue})">
or, using the dotted notation,
<cfinput type="text" name="Employerx" id="Employerx" size="50" autosuggest="cfc:/binkley.TrackData.NoMenu.employers.lookupEmployer({cfautosuggestvalue})">