Skip to main content
Inspiring
November 19, 2008
Question

Autosuggest icon

  • November 19, 2008
  • 7 replies
  • 2878 views
Can anyone give me tips on how to change the default autosuggest loading icon to a custom icon? I have a custom icon and would like to serve it locally from my Web site rather than change it in the CFIDE\scripts\ajax\resources\cf\images\ folder. I tried serving the autosuggest.js file locally (in my site on IIS) but my input fields quit working and the icon links were broken. Any help or pointers to instructions would be appreciated.
    This topic has been closed for replies.

    7 replies

    cflingoAuthor
    Inspiring
    December 4, 2008
    This appears to be the way to do it without mucking about in the CF8 CFIDE folder which is what I was after. Thanks to all who replied. I'm referencing the link that Daverms provided!!!
    BKBK
    Community Expert
    Community Expert
    December 4, 2008
    It's an attribute of the cfinput tag in CF8.

    cfinput type="text" name="company" autosuggest="cfc:autosuggest.getCompany({cfautosuggestvalue})" id="company" onFocus="clearCompField();" size="40" maxlength="50" showautosuggestloadingicon="true" maxresultsdisplayed="15"

    See showautosuggestloadingicon.


    OK, thanks. Apparently, the Javascript function responsible for it is in the file \CFIDE\scripts\ajax\package\cfautosuggest.js. You will find the code for the image path near the beginning of the script. It consists of the two lines,

    var staticgifpath=_cf_ajaxscriptsrc+"/resources/cf/images/static.gif";
    var dynamicgifpath=_cf_ajaxscriptsrc+"/resources/cf/images/loading.gif";

    It seems that Coldfusion toggles between the two images. I'm only guessing; you should take a look. This is a system script, so make a backup before you go poking it.

    Inspiring
    December 4, 2008
    You can generate the loading icon at,

    http://www.ajaxload.info/

    cflingoAuthor
    Inspiring
    December 4, 2008
    Understood but how do you serve the custom icon without changing the default icon that CF8 uses? I know you can customize the CSS file by creating an ajax/resources/cf/cf.css directory in your Web site on IIS. There must be a way to do the same with the icon too without altering anything in the CFIDE folder.
    Inspiring
    December 4, 2008
    See "Eric Pfleckl" 's comment in this thread!...

    http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54067

    HTH
    BKBK
    Community Expert
    Community Expert
    December 4, 2008
    Could you post an example of code that shows the icon?


    cflingoAuthor
    Inspiring
    December 4, 2008
    It's an attribute of the cfinput tag in CF8.

    cfinput type="text" name="company" autosuggest="cfc:autosuggest.getCompany({cfautosuggestvalue})" id="company" onFocus="clearCompField();" size="40" maxlength="50" showautosuggestloadingicon="true" maxresultsdisplayed="15"

    See showautosuggestloadingicon.
    Inspiring
    December 4, 2008
    Hi,

    You can replace the custom loading icon by replacing the "loading.gif" image in
    cfide/scripts/ajax/resources/cf/images with any image you wish.

    HTH


    BKBK
    Community Expert
    Community Expert
    November 24, 2008
    I've been looking for a clue in the following example. Does it show the icon you're referring to?

    <cfform>
    <div style="float: left"> Name(Anna, John, Peter?): </div>
    <cfinput name="userName" type="text" autosuggest="Anna, John, Peter">
    </cfform>



    Inspiring
    December 3, 2008
    No icon appears for me with this code. Just blue background suggestion choice. It would be nice to change the suggestion background color to something softer on the eyes than bright blue.
    BKBK
    Community Expert
    Community Expert
    November 23, 2008
    Do you mean the image that appears when one types into a cfinput/autosuggest field? Could you please show a code example of your form?

    BKBK
    Community Expert
    Community Expert
    November 20, 2008
    What icon are you referring to?

    cflingoAuthor
    Inspiring
    November 20, 2008
    I am referring to the autosuggest (animated) icon that appears to the right of the TextInput field.