This effect contains a single error container for all validation
errors. Here it is
Styling the error container
The form itself uses this
external
stylesheet. We have added addional styling for the error message
container. Nothing special here.
The custom effect
Here is the custom effect. It is added
with $.tools.validator.addEffect method as described
in Making custom effects
section of the validator documentation. The effect takes the
container, makes it visible and adds the messages inside it. It is
only triggered upon form submission and not when fields are edited.
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
the User's
Manual.
Using the effect
Now we initialize the validator and also make a custom form
submission logic.
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.