submit_to_remote question

I've put together what should be a dirt simple submit_to_remote and can't seem to get it working. This is gem Rails 1.2.3. Here's the code:

<% form_tag do %>
   <div id="final_link"></div>
   <%= submit_to_remote('ok', 'ok', :action => 'foo') %>
<% end %>

   def foo
     if request.post?
       render(:update) do |page|
         page.replace_html :final_link, 'bar'
       end
     end
   end

What happens is that when I click on 'ok', Firebug tells me:

$(form) has no properties
[Break on this error] return $A($(form).getElementsByTagName('*')).inject([],

Prototype is included. What am I doing wrong?

Thanks