Validating forms using html5

Of course, we developers well know that not all the software we write is the fruit of our creativity.

Sometimes we have no other option than to write the same boilerplate code for the umpteenth time.

validating forms using html5-47

Using a specialized plug-in such as j Query Validation is mostly a palliative remedy that doesn't really solve the problem.However, checking that a given field isn't left blank on a form doesn't require knowledge of the business context and can be done more effectively at the markup level.In this article, I'll discuss core features common to all input fields and the tools HTML5 gives you to control the process of form validation.In upcoming articles, I'll cover new and more specific types of input fields, such as numeric and date fields.Figure 1 shows the field-input tooltip that each of three browsers -- Chrome, Firefox, and Opera -- currently provides.

As you can see, each browser displays a different message.

The latest versions of all major browsers -- Internet Explorer (IE), Chrome, Firefox, Safari, and Opera -- offer superb support for HTML5, but if you happen to use an older version (even a few months older), you might run into trouble.

As far as the attribute has long been supported, and backward compatibility is probably isn't a big concern.

Should you accept the default browser behavior or try to customize it to some extent?

As I see it, there are good reasons for taking either approach.

Checking whether a required field is left blank is only half of the problem.