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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with AJAX Autosuggest control

Status
Not open for further replies.

LyndonOHRC

Programmer
Sep 8, 2005
603
US
I'm trying to figure out how to use autosuggest populated with ajax in a cfform. I have Ben Forta's example and slightly modified it to fit my needs. I get a javascript error "exception thrown and not caught" on line 799 of the client document, yet the client file only has 640 lines? The error comes in focus after the first character is typed in the text box and the autosuggest never populates.

I'm on a dedicated windows 2008 server with CF8. Any help appreciated.

CFC File:
Code:
<cfcomponent hint="Owner database functions">
	<cffunction name="lookupOwner"
			access="remote"
			returntype="string"
			hint="Lookup method for Ajax auto-suggest">
		<cfargument 
			name="search"
			type="any"
			required="false"
			default="">
		
		<cfset var data="">
		
		<cfquery datasource="HDRegistry" name="data">
			SELECT OwnerName
			FROM Owners
			WHERE UCase(OwnerName) LIKE UCase('#ARGUMENTS.search#%')
			ORDER BY OwnerName
		</cfquery>
		
		<cfreturn ValueList(data.OwnerName)>
	</cffunction>
</cfcomponent>
HTML File:
Code:
<br><br>
<cfform>
   Owner:
   <cfinput type="Text"
            name="OwnerName"
            autosuggest="cfc:CFCFile.lookupOwner({cfautosuggestvalue})"
            size="50"
            maxlength="100">
   <cfinput type="submit" value="Search" name="submit">
</cfform>

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
I solved this one myself. Turns out, no HTML is allowed in the application.cfm file for this method to work. I had my cfinclude for my applications menu in there and it interfered somehow. I'm not real sure exactly how/why but I'm studying the process now.



Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top