July 14, 2012 7:31 am

Submit a form without page refresh PHP & jQuery

In this tutorial we have a simple form with name, email & phone number. The form submit all fields to a PHP script without page refresh, using native jQuery method (native meaning, you don’t need to download any extra plugins to make it work.

First of all you need to make a HTML form.

HTML Code

Simple HTML Code

 JavaScript Code

Simple JavaScript Code

JavaScript Library Include

 PHP Code

Simple PHP Action File

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.


Tutorial Categories:
  • irfan

    HI, i got help from the above mentioned code,its really v nice. thanks…. 🙂

  • Somehow feels great, But you could have made this code more clean and more clear.

    It’s great in this case as well.

    I want you to prevent click so that page may avoid refreshing.

    user following section to prevent refreshing your page.

    return false;

    at the end of your function before “}”,

    Or you may use e.preventDefault();

    Hope you will change your code to this.

  • herizal amin

    nice example.., thanks

  • Rajesh .S

    thanks

  • Kingsly

    Good Example

  • Hello Guys,

    This is look great, but I can’t download the download file. Anyone can send me the zip file? I register to your feedburner but looks that area have error..

    Thank you

  • Thanks Dear… it was very much helpfull

  • yup

    paki oye

  • ayaya

    esto no funsiona me parese a mi ke esto es vasura porke pornes esta bazofia pequenyo trozo de mierda al sol

  • rashida

    code for writing comments and updating on the page immediately

  • dfbd

    hgd

  • shoaib

    thanks buddy

  • asfaq

    worst code ever making fool don,t downloas

  • Jeremy

    Thanks. It looks pretty simple.