Hi 

I'm trying to incorporate an Ajax autosuggest feature into a Coldfusion
search page I have. 

The example I have found is for PHP, and I'm trying to get this to work
with Coldfusion

The original autocomplete script and working example can be found
athttp://www.brandspankingnew.net/archive/2007/02/ajax_auto_suggest_v2.h
tml

When trying the search form, I am not getting any errors, but the
autocomplete box is not appearing.

Any ideas on what is causing the autocomplete not working correctly?

Ian

--- SEARCH FORM---
<div>
<form method="get" action="">
<label for="testinput_xml">Person</label>
<input type="text" id="testinput_xml"  name="surname" value=""
style="width:300px" /> 
<br /><br />
<input type="submit" value="submit" />
</form>
</div>


<script type="text/javascript">
var options_xml = {
script: function (input) { return
"include.cfm"+input+""+document.getElementsByTagname('rs')[0].getAttribu
te('info').value; },
varname:"input" };
var as_xml = new bsn.AutoSuggest('testinput_xml', options_xml);
</script>

----- INCLUDE.CFM -----------------

<cfsetting enablecfoutputonly="yes">
<cfquery name="getNames" datasource="dsn">
  SELECT surname
  FROM ourtablename
  WHERE surname LIKE <cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.surname#">
  ORDER by surname ASC
</cfquery>


<cfsavecontent variable="theXML">
<cfoutput><?xml version="1.0" encoding="UTF-8"?><results></cfoutput>
<cfloop from="1" to="#getNames.recordcount#" index="ctr">
      <cfoutput>
      <!--- add the XML config entry --->
      <rs id=""
info="#getNames.surname[ctr]#">#getNames.surname[ctr]#</rs>
    </cfoutput>
</cfloop>
<cfoutput>
</results>
</cfoutput>   
</cfsavecontent>
<cfoutput>#theXML#</cfoutput>

------------------



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312565
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to