Submitting a form via AJAX

Ok so here is a very simple yet descriptive example how web-forms can be submitted using AJAX. This is an advanced tutorial, so although I’ll try to explain everything, I am assuming that the reader has a basic understanding of php and javascript.

AJAX is Asynchronous JavaScript And XML. Its a client side method to communicate data with a server. Asynchronous means that this communication can take place without interfering with other client side processes. (As we’ll see later, the asynchronous part is optional). Javascript is the main framework where AJAX works and XML is a format in which data might be communicated. Although this is not necessary. Data might be communicated in text, JSON, etc formats also.

Lets jump right in and look at this live demo.

Ok, lets look at the code now. The HTML structure is something like this:

Continue reading