JavaScript
  Home arrow JavaScript arrow Developing the Client-Side Code for Server...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Developing the Client-Side Code for Server-Side Data Validation with AJAX
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2006-07-18

    Table of Contents:
  • Developing the Client-Side Code for Server-Side Data Validation with AJAX
  • Triggering HTTP requests in the background: meet the world of requester objects
  • Processing server responses: defining the “displayErrorMessage()” function
  • Controlling the flow of data validation: defining the “initializeForm()” function
  • Integrating the client-side application layer: listing all of the JavaScript functions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


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


    (Page 1 of 5 )

    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.

    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!

    More JavaScript Articles
    More By Alejandro Gervasio


       · In this second article of the series, all the JavaScript functions that compose the...
       · where to find the third part of Server-Side Data Validation with AJAX? I cann't find...
       · Thank you for your interest on my AJAX article. You can read the last part...
     

    JAVASCRIPT ARTICLES

    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT