Form Validation

In this lesson, we will go over the concept of form validation.

We'll cover the following...

When you collect information on a web page, nothing prevents your users from providing something different than what you ask for. For example, they may leave a textbox empty, type names where you expect numbers, provide a phone number instead of an e-mail address, and so on. When they click the submit button, all data goes to the server as it is filled out.

If your server-side does not validate the data, it could get wrong information which leads to errors and confusion. It is trivial that the server-side checks all data coming from the browser, the browser—the server-side must not trust that the client-side sends valid data.

However, sending invalid data to the server-side consumes ...