4 AJAX Form Validation Validating input data is an essential requirement for quality and secure software applications. In the case of web applications, validation is an even more sensitive area, because your application is widely reachable by many users with varying skill sets and intentions. Validation is not something to play with, because invalid data has the potential to harm the application's functionality, and even corrupt the application's most sensitive area: the database. Input data validation means checking whether the data entered by the user complies with previously defined rules, which are established according to the business rules of your application. For. | 4 AJAX Form Validation Validating input data is an essential requirement for quality and secure software applications. In the case of web applications validation is an even more sensitive area because your application is widely reachable by many users with varying skill sets and intentions. Validation is not something to play with because invalid data has the potential to harm the application s functionality and even corrupt the application s most sensitive area the database. Input data validation means checking whether the data entered by the user complies with previously defined rules which are established according to the business rules of your application. For example if you require dates to be entered in the YYYY-MM-DD format then a date of February 28 would be considered invalid. Email addresses and phone numbers are other examples of data that should be checked against valid formats. Carefully define the input data validation rules in the software requirements document of the application you re developing and then use them consistently to validate your data Historically web form validation was implemented mostly at the server side after the form was submitted. In some cases there was also some JavaScript code on the client that performed simple validation such as checking whether the email address was valid or if a user name had been entered. The problems encountered with traditional web form validation techniques are Server-side form validation meets the limits of the HTTP protocol which is a stateless protocol. Unless special code is written to deal with this issue after submitting a page containing invalid data the user is shown back an empty form that has to be filled from scratch. When submitting the page the user needs to wait for a full page reload. For every mistake that is made when filling the form a new page reload happens. In this chapter we will create a form-validation application that implements the good old traditional techniques and adds an