Here we have a form that has valid HTML5 syntax. We have
used email, url and number
inputs as well as a normal text input with
a pattern attribute. The requred attribute
is used to indicate a mandatory field. The old school but
handy maxlength attribute makes it impossible to enter
more than 30 characters.
This is the simple part. Simply initialize validator and you'll get
all the HTML5 niceties.
You need to place the script block after the
HTML code or you can alternatively use
jQuery's $(document).ready to execute the script as
soon as the webpage's Document Object Model (DOM) has been
loaded. Read more about that from
We have used one external
the design. It has styling for the whole form. Here we focus on the
validation and the error message:
The new jQuery Tools book by Alex Libby explores the library in a
precise and structured fashion. If you are getting started on jQuery Tools or
looking for better ways to use the library, this book will be your ally.