views:

132

answers:

2

Is there a way, and how can I remove the loading animation that's built into the ColdFusion AJAX functions?

<cfinput type="text" name="TitleName" autosuggest="cfc:MyCFC.AutoSuggestSearch({cfautosuggestvalue})">

Using the following code creates a small icon next to my search field which animates while the AJAX request is waiting for a response. Is there a way to remove this animation icon?

+1  A: 

Try adding this to the head section of your page:

<script language="JavaScript"> 
_cf_loadingtexthtml=""; 
</script>

Note that you should be able to put your own HTML into that string, to display a custom loading graphic or some other message instead, if you like.

Adam Tuttle
Thanks Adam. Although all that does is stop the icon from animating. I want to remove it completely. Precisely, I want to remove the layer. I have a search button next to the input field, and for aesthetic reasons I would like to merge the button with the field (to use an magnifying glass background for example). But the loading layer shows up and creates space between my input and the button. That is the layer that I want to remove.
Mel
I created a little back by setting the visibility of the image and its holding div to "collapsed." But that only hides the animation, it doesn't actually collapse the layer). To get around that I set the button to negative margin. Note that the layers are floated right.
Mel
+1  A: 

The following code does not work for me:

<script language="JavaScript"> 
_cf_loadingtexthtml=""; 
</script>

My solution was to use "visitbility:hidden" on the following layers generated by ColdFusion, and to use negative margins to remove the space reserved for the image (note that "collapse" does not work:

#TitleNameloadingicon {visibility:hidden;}
#TitleName_cf_button {visibility:hidden;}

This solution was further improved by Adam Tuttle, who suggested using "display:none" instead of "visibility:hidden;" which entirely eliminates the space reserved for the loading graphic.

Mel
Instead of using visibility:hidden, you can use display:none, which will not use any space, instead of having the space used but its contents invisible.
Adam Tuttle
Adam, I tried that already, and I also tried "collapse." It seems there is no way to make the space disappear. I'll go over my code to make sure I haven't missed anything.
Mel
Adam, sorry, I missed read your comment. You are right, using "display:none" does remove the space entirely. Many thanks.
Mel