Home arrow JavaScript arrow Developing the Client-Side Code for Server-Side Data Validation with AJAX
JAVASCRIPT

Developing the Client-Side Code for Server-Side Data Validation with AJAX


If you're a strong advocate of integrating AJAX into your Web applications, then this article might fit your needs quickly. Welcome to the second part of the series "Server-side validation with AJAX." In three parts, this series walks you through the basic steps of how to implement an AJAX-driven data validation system, which delivers the high responsiveness of JavaScript for displaying error messages, while maintaining the safety and reliability of server-side input validation.

Author Info:
By: Alejandro Gervasio
Rating: 4 stars4 stars4 stars4 stars4 stars / 18
July 18, 2006
TABLE OF CONTENTS:
  1. · Developing the Client-Side Code for Server-Side Data Validation with AJAX
  2. · Triggering HTTP requests in the background: meet the world of requester objects
  3. · Processing server responses: defining the “displayErrorMessage()” function
  4. · Controlling the flow of data validation: defining the “initializeForm()” function
  5. · Integrating the client-side application layer: listing all of the JavaScript functions

print this article
SEARCH DEVARTICLES

Developing the Client-Side Code for Server-Side Data Validation with AJAX
(Page 1 of 5 )

Introduction

As you'll probably remember if you read the first article of this series, I started this three-part tutorial by demonstrating how a good combination of AJAX and a few PHP data checking routines can be used for constructing a decent form validation mechanism. Since I intended to bring you an easygoing guide for how to create such a system, over the first article I created a simple online form, in conjunction with some CSS declarations. My plan was to implement this data verification system from scratch, and add progressively the different layers that make up the complete AJAX application.

Now that the (X)HTML markup is defined, and a simple web form is available for testing, over this second article I'll show you the concrete definitions for all the pertinent JavaScript functions. These functions will be tasked with sending out HTTP requests in the background and handling all the events generated when a user enters data into the corresponding text boxes. For this reason, I like to think of them as the workhorses of the data validation system.

By the end of this installment, you will know how to use AJAX for calling some PHP classes, handy for checking user-supplied input on the server. You'll also have expanded your existing background on AJAX by integrating a few additional concepts, like using the popular "responseText" property of requester objects, and creating callback functions on the client which are capable of processing the disparate responses generated on the web server.

If all the benefits that I mentioned before sound good to you, then it's time to start learning how AJAX can assist you in performing server-side data validation. The experience won't be the shortest, but it will be fun. So, let's get going!


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials