Home arrow AJAX & Prototype arrow PHP AJAX Form Validation

PHP AJAX Form Validation

Many sites feature web forms to collect information from users. Unfortunately, these forms often provide a poor experience for the user, with predictable results. This article will show you how to make filling out web forms more fun (or at least less painful) for your users with the help of PHP and some AJAX magic.

TABLE OF CONTENTS:
  1. PHP AJAX Form Validation
  2. AJAX Validation Process Overview
  3. AJAX Web Form and the Required Files
  4. The PHP script to process AJAX inputs
By: Codex-M
Rating: starstarstarstarstar / 87
October 22, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

One of the most important requirements for PHP web forms is usability; it's the goal of many web designers to improve the user's experience. With classic PHP web forms, a user is required to enter information in the form and then press the submit button. The PHP script will then validate the data entry to make sure the user has entered the correct information -- if it is correct, the user will then be taken to a new page (a success page, for example).

However, things can get a bit uncomfortable in the classic PHP web form when a data entry mistake occurs. If a mistake occurs, PHP will output error messages on the other pages, and the user will be required to type all the information in over and over again. This might be OK for shorter web forms, but it is inefficient for longer web forms (such as a sign up form on large websites where lots of fields are required like the address, phone number, birthday, etc).

The obvious result of this process is a poor user experience. If your web form is not user-friendly, users will avoid your website, and worse, this will affect your sales.

With the use of AJAX, PHP web forms can be made as user friendly as possible. In this article, I will show how to use AJAX technology along with PHP to make user friendly web forms that satisfy the requirements listed below:

1. If a mistake occurs, accurate feedback from the server will be shown to the user, pinpointing where the exact data entry mistake occurred.

2. If a mistake occurs, aside from giving accurate feedback, the user will not need to type in all the fields all over again. This means the page will not be reloaded or refreshed.

3. If there is no mistake or the user successfully enters all the information correctly, the correct information can be shown.



 
 
>>> More AJAX & Prototype Articles          >>> More By Codex-M
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

AJAX & PROTOTYPE ARTICLES

- Best AJAX Tutorials for Forms
- The Best AJAX Tutorials
- 8 Great Ajax Tutorials
- Using Ajax and jQuery
- Using Ajax and jQuery with HTML Forms
- Ajax.org Offers Cloud9 IDE for JavaScript
- Java Technologies Provider ICEsoft Releases ...
- Using Recaptcha in AJAX Prototype Framework ...
- Google's Closure Compiler Service API: Addit...
- Installing Google Web Toolkit: Introducing t...
- Google's Closure Compiler Service API: Displ...
- Google's Closure Compiler Service API: Deliv...
- Google's Closure Compiler Service API: the A...
- Google's Closure Compiler Service API: the S...
- Google's Closure Compiler Service API: Optim...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: