What are HTML5 Form Validation Patterns
When creating forms in HTML 5, you need a way to validate if the user inputted the correct data into a field. Using what is called a “pattern” attribute, you can make sure that the user did actually input the right data in a field. Different fields can accept different input, for example there are Name, Date, Phone, Email, and other field types.
A point to keep in mind is that you don’t over do it and add too many constraints as this might impact the usability of your forms (or your site).
Resources
There are a number of sites that can help you control user input. My favorite is http://www.html5pattern.com/ .
You can also use placeholders to provide suggestions of the type of data expected from a user.
Last Updated on December 27, 2015 by Code Guru