From the course: HTML and CSS: Creating Forms
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Validation
From the course: HTML and CSS: Creating Forms
Validation
- [Instructor] The goal of validation is to make sure users are entering the data you want. That could be anything from having the correct number of digits in the ZIP code to ensuring nobody can make malicious file uploads. There are different ways to provide validation, which can be roughly divided into three categories. A form can do some limited validation in the browser when the Submit button is clicked, but before the form is actually submitted. We saw this early in the course with input types like email and URL. The browser has built-in validation for certain types of inputs. If you want a client-side validation that is more widely supported or is more flexible than the browser default validation, that's commonly done with JavaScript. You don't necessarily have to write JavaScript from scratch. There are many libraries and frameworks that do validation that you can implement easily on your site. Client-side validation can also be done inline. This is when the user gets a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.