JavaScript
  Home arrow JavaScript arrow Page 4 - A Basic Approach to Server-side Data Valid...
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  
Mobile Linux 
App Generation ROI 
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

A Basic Approach to Server-side Data Validation with AJAX
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2006-07-11

    Table of Contents:
  • A Basic Approach to Server-side Data Validation with AJAX
  • A picture is worth a thousand words: defining the look and feel of the application
  • Building a basic sample form: defining the front-end of the AJAX-based form checking system
  • Spicing up the sample form: defining a few CSS declarations
  • Putting the pieces together: listing the full (X)HTML markup and CSS styles of the AJAX application

  • 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


    A Basic Approach to Server-side Data Validation with AJAX - Spicing up the sample form: defining a few CSS declarations


    (Page 4 of 5 )

    As I mentioned in the previous section, the next thing I have to do is define a few CSS declarations to polish the look and feel of the online form, as well as the remaining elements of the web document. There's no need to mention that you can code your own CSS styles and give the web page a completely different presentation; as you know, here I'm exposing only an example, thus feel free to write the CSS styles that best suit your personal needs.

    Okay, having defined the structural markup of the AJAX applications, here is the full list of styles that I'll attach to the web page's elements:

      body {
        margin: 0;
        padding: 0;
      }
      p{
        text-align: center;
        font: bold 24px Arial, Tahoma;
        color: #000;
      }
      p{
        font: bold 12px Arial, Tahoma;
        color: #000;
        text-align: right;
        margin-right: 50px;
      }
      #formcontainer{
        width: 350px;
        height: 300px;
        padding: 5px;
        background: #efdfff;
        border: 1px solid #ccc;
        margin-left: auto;
        margin-right: auto;
      }
      #msgcontainer{
        width: 300px;
        height: 30px;
        padding: 10px;
        font: bold 12px Arial;
        color: #f00;
        text-align: center;
      }
      .inputbox{
        width: 200px;
        font: normal 12px Arial;
        color: #000;
      }
      .formbutton{
        width: 100px;
        font: normal 12px Arial, Tahoma;
        color: #000;
      }

    If you examine the above CSS declarations, then you'll see that they're extremely simple. Basically, I styled the respective form boxes and the submitting button, while the remaining selectors are responsible for styling the containing DIVs that wrap up the online form and the area for displaying error messages. That's about it.

    All right, since the above CSS rules bear not much discussion due to their simplicity, feel free to jump straight into the upcoming section, where I'll be showing you the full (X)HTML markup code of this small AJAX application, along with the CSS rules that you saw before.

    More JavaScript Articles
    More By Alejandro Gervasio


       · This first part of the series introduces a comprehensive approach on how to validate...
       · Hi.I congratulate you on the good tutorialbut I'm wondering what happens if...
       · Hello Wisher,Thank you for commenting on my AJAX article. Concerning your...
     

    JAVASCRIPT ARTICLES

    - Using Click Interceptions with a Database-Dr...
    - Using JavaScript Click Interceptions in an I...
    - Using Click Interceptions with JavaScript
    - QuickSort in Action
    - Quicksort
    - 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






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