Try this fake change password form.
If you enter correct password/confirmation you will see a success message, otherwise you will see an error message.
The server waits for one second to simulate a long response.
Transparent message will fade automatically after two seconds.

Password
Confirm
 

Rails code explained

You just need to add on line in your view and two more options to the form_remote_tag.

To generate code for overlay message:
<%= transparent_message_create("ajax_info_message", "Saving password<br/>", "/images/progress_FFF.gif") %>
To display/hide overlay message add :loading and :complete options
<%= form_remote_tag( :url => {:action => "post"}, 
                     :html => {:id => "password_form"},
                     :loading  => transparent_message_show('ajax_info_message', {:hideMode => "'none'", 
                                                                                 :showMode => 'null', 
                                                                                 :insideElement => {:id => "'form'"}}), 
                     :complete => transparent_message_hide('ajax_info_message')) %>

CSS File (toggle)

Full view code (toggle)