Whatever message this page gives is out now! Go check it out!

ColdFusion.Autosuggest.getAutosuggestObject

Last update:
May 18, 2026

Description

Lets you access underlying YUI AutoComplete object thereby providing fine-grained control over the object, for example attaching an event.

Returns

The underlying AutoComplete object.

Function syntax

ColdFusion.Autosuggest.getAutosuggestObject (Id)

Parameters

  • Id: Name of the auto-suggest object.

Example

<html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <cfajaximport tags="cfinput-autosuggest"> <script> var init = function() { autosuggestobj = ColdFusion.Autosuggest.getAutosuggestObject('state'); autosuggestobj.itemSelectEvent.subscribe(foo); } var foo = function(event,args) { var msg = ""; msg = msg + "Event: " + event + "\n\n"; msg = msg + "Selected Item: " + args[2] + "\n\n"; msg = msg + "Index: " + args[1]._nItemIndex + "\n\n"; alert(msg); } var getStates = function(){ return ["California","Connecticut","Colorado","Illinois","Alabama","Iowa","Utah", "Alaska"]; } </script> </head> <body> <h3>Attaching an event handler to the autosuggest object</h3> <cfform name="mycfform" method="post" > State:<BR> <cfinput type="text" name="state" autosuggest="javascript:getStates({cfautosuggestvalue})" autosuggestMinLength=1 autosuggestBindDelay=1> <cfset ajaxOnLoad("init")> </cfform> </body> </html>

See also

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page