Another way you can notify users of errors or required fields is through styling. New CSS selectors allow you to set styles for input elements based on whether they are valid or invalid, or they are required or optional.

In the example below, the borders are styled for invalid conditions. If required fields are empty, or validated fields have invalid data, their borders are styled red.

Registration
User Name
Password
Email
Telephone number
City
State
Birth year
How did you learn about our site? Through a friend
Read about it on a website
Heard a radio advertisement
Other source
I agree to the terms of service for this site.
Form submitted.