• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer

My Code Guru

Coding Made Easy

  • Programming Languages
  • Web Technologies
  • Resources

How to Use HTML5 Form Validation Patterns

December 27, 2015 by Code Guru

What are HTML5 Form Validation Patterns

Contents hide
What are HTML5 Form Validation Patterns
Resources

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

Filed Under: HTML

Primary Sidebar

More to See

The Top 20 Programming Languages

The Top 20 Programming Languages

April 24, 2018 By Code Guru

HTML5 Workflow

The World’s Most Powerful HTML5 Workflow

April 24, 2018 By Code Guru

Footer

About

My Code Guru is a new blog about computer programming resources, tips, tricks and techniques. The blog is intended for beginning or aspiring programmers to help them find the right coding resources quickly.

Recent

  • 5 Ways ChatGPT Can Help You Write Better Code Faster in 2023
  • How to Use Chrome Developer Tools
  • The Top 20 Programming Languages
  • The World’s Most Powerful HTML5 Workflow
  • How to Migrate a WordPress Site to a New Host

Search

Tags

How To Tutorials

Copyright © 2025 · MyCodeGuru.com . Website design by LightWeb Media