Link_to_remote loadind indicator problem


This is a bit of a strange one but i basically i have a link_to_remote which takes the value from an autocomplete field and puts it in a table by rendering a partial via ajax.

I have a before and success to display a spinning image before and hide it when complete. What is happening is the spinning image is being displayed when i click the link_to_remote but dissappearing straight away and then a second or so later my partial is rendered. If i remove the autocomplete box and put a select drop down menu as a test this works fine.

Ive tried the different options from the api like :loading => but still have the same problem with the autocomplete box. Ive tried everything i can think of. Has anyone any ideas?? code is below.

<%= link_to_remote "Add Company to News", :url => {:action => 'add_company_news_row'},                                                   :before => "'loading')",                                                   :success => "Element.hide('loading')"

<p id="loading" style="display: none;"><%=image_tag 'spinner.gif', :alt => 'Updating...'%> Updating Please Wait...</p>