Submit form without page refresh

I'm looking for an ajax script from submitting a form without page
refresh. The script should have these abilities:

1. Submit form without page refresh
2. Display loading icon (or some text) while the script processing the
code
3. Display different message if the form has submitted successfuly,
and different if it doesn't.

Can anyone help?

I'm looking for an ajax script from submitting a form without page
refresh. The script should have these abilities:

1. Submit form without page refresh
2. Display loading icon (or some text) while the script processing the
code
3. Display different message if the form has submitted successfuly,
and different if it doesn't.

the form_remote_tag/remote_form_for helpers can do this.

Fred