Chapter 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.
Note
Carefully define the input data validation rules in the software requirements...