Form_for success and failure callbacks

I’ve created a login form using rails 3 & jquery-ujs and all is working
except I’d like to detect whether the AJAX call to the server was
successful, for example in the event that internet connection is lost.

I’m using form_for but digging through the docs doesn’t seem to have
anything to help with this.

My current tag looks like…
<%= form_for @user_session, :remote => true, :html => { :onsubmit =>
“displayProcessing()” } do |f| %>

I’ve tried adding :success and :failure but these don’t seem to work.

Could anyone give me any pointers?

Cheers, Phil

Still stuck with this problem.

Does no one have any pointers on this?