In this chapter we will discuss about functions and data validation. Functions are used when you want something to be initiate at the right time and right place. It will hold a block of code that you have written and will be executed when you want it to be executed. Data validation are mostly used for forms when users type their information. Information that are placed into the web need to be correct, therefore data validation comes in very handy.
Functions can hold a block of javascript code that can be executed. Its a great tool to use when a condition has been met by the user, because if you want something to happen after the user has completed a task, a code can be executed.
Data validation is taking user input and validating if the data is correct or not. This is a useful tool if the user is enter something wrong, for example typing more than 5 digits in the zip code section.