PHP form submit without page refresh using jquery.

This post helps you to submit your form without refreshing page. In this tutorial I will show you how simple it is to do using jQuery form plugin just five lines of JavaScript code, no need to post data string values via ajax. Explained collaboration with validate plugin for implementing form field validations.

JavaScript Code
$(“#form”).ajaxForm()– form is the ID name of the FORM tag. While submitting FORM ajaxForm() method posting data to submit.php without refreshing page. Result will show in #preview.

Simple HTML code. FORM contains three input fields name, email and message.


Contails simple PHP code. Inserting values into contacts table.

 Validate Plugin
Here the collaboration of jQuery validate and form plug-in.

PHP database configuration file