AJAX Email Form

I couldn’t find any information on how to create an ajax email form.

Basically on the page there is a form, when the user presses submit it goes to a new page and gives a confirmation message and sends an email to me.

I want to integrate AJAX now so that the email is sent on the same page as the form and a popup box should appear with the confirmation message.

Can anyone provide me with a sample solution please?

Anyone able to help?

In your controller check if the request is an ajax request, if it is ajax then perform the operation and return the desired results in json format, in your view file have jquery deal with the results. where you check if the request is ajax, if it fails you should have mechanism set in place so your operation will still be completed if javascript on the browser is turned off.

Cheers jayrulez :)