File_field and observe_field

Hi everyone,

I have an upload form in my app, which obviously has a file_field. After
the user has selected a file I want to use an observe_field to check if
the selected file already exists on the server. I tried it like this,
but somehow it doesn’t work:

<%= file_field ‘myfile’, ‘myfile’ %>
<%= observe_field(‘myfile_myfile’,
:update => ‘error’,
:loading => “Element.show(‘spinner’)”,
:complete => “Element.hide(‘spinner’)”,
:url => { :controller => ‘file’, :action =>
‘validate_filename’ } ) %>

When I edit the generated javascript a little bit and do it like this it
DOES work:

<%= file_field ‘myfile’, ‘myfile’, :onchange => “checkFile();” %>

Is this a known issue with observe_field or am I doing something wrong?

I have another question about this: the spinner doesn’t dissapear in
Safari (it does work in Firefox; haven’t tried IE yet). Does anyone see
what I’m doing wrong there? As a work-around I let the controller send
back javascript to hide the spinner again, but it would much neater if
onComplete would just work.

Thanks!!

Mischa.