A Basic Approach to Server-side Data Validation with AJAX
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 (Page 2 of 5 )
A good place to start building this AJAX-driven form validating mechanism is precisely with defining its look and feel. Constructing its (X)HTML structure, and then its visual presentation, will help give you a better idea of how the application will look at the end of the development process.
To reaffirm the above opinions, below I've included a simple screen shot, which illustrates basically how the form validation system will look, in addition to simulating a hypothetical situation where data entered on an online form is verified. Please, take a look at the following image:
As depicted above, the AJAX-based form checking application will validate the data supplied by users, as soon as these values are typed into the corresponding fields. Notice in the above image how the application shows a descriptive error message, indicating whether the data inputted is correct or not.
In this case, by combining the best of client and server technologies, it's possible to build the system that I described (and illustrated) a few lines before.
Now that you know how the AJAX application will look, it's time to move forward and start defining its corresponding (X)HTML markup. Doing so, it'll be much simpler for you to tweak the structural code and introduce your own modifications.
Over the course of the upcoming section, I'll be defining the respective (X)HTML structure for a sample form, similar to the one you saw in the previous screen shot, therefore go ahead and continue reading. It's really worthwhile, trust me.