NATIVE CLIENT SIDE VALIDATION OF WEB FORMS
Validating forms has notoriously been a painful development experience. Implementing client side validation in a user friendly, developer friendly, and accessible way is hard. Before HTML5 there was no means of implementing validation natively; therefore, developers have resorted to a variety of JavaScript based solutions.
To help ease the burden on developers, HTML5 introduced a concept known as constraint validation – a native means of implementing client side validation on web forms.
Yet, despite being available in the latest version of all major browsers, constraint validation is a topic largely relegated to presentations and demos. My goal in writing this is to shed some light on the new APIs to help developers make better web forms for everyone.
In this tutorial I will:
- Present a comprehensive overview of what constraint validation is.
- Dig into the current limitations of the spec and browser implementations.
- Discuss how you can use HTML5 constraint validation in your forms now.
WHAT IS CONSTRAINT VALIDATION?
The core of constraint validation is an algorithm browsers run when a form is submitted to determine its validity. To make this determination, the algorithm utilizes new HTML5 attributes min
, max
, step
, pattern
, and required
as well as existing attributes maxlength
and type
.
dETAILS
sOURCE
HTML5ROCKS
I simply want to tell you that I am beginner to weblog and really loved your web site. Very likely I’m likely to bookmark your site . You surely have beneficial articles and reviews. Appreciate it for sharing your website.