Optionally: Each input can have a label associated with it, where the 'for' attribute of the label refers to the 'id' attribute of the input.It's also a common practice to have 'id' and 'name' attributes with the same value, although keep in mind that since this plugin does not use the 'id' attribute, this is not mandatory.For example, if you're writing a custom method for validating email addresses inside a single field, you could call the existing email method for each email: An error message displays a hint for the user about invalid elements, and what is wrong. Via the title attribute of the input element to validate, via data attributes, via error labels and via plugin settings (option ).

validated without validating-67validated without validating-41

Plugin settings produce cleaner markup, though valid markup results from both.

If your form consists of fields using names that aren't legal Java Script identifiers, you have to quote those names when using the Whenever you have multiple fields with the same rules and messages, refactoring those can reduce a lot of duplication.

By default, the first invalid element in a form is focused after submitting a form with invalid elements.

To prevent confusion on the behalf of the user, the plugin remembers the element that had focus when the form was submitted, and refocuses that element.

The ultimate goal of this plugin is to make working with forms more fun for everyone.

By improving the interaction, it is easier and less annoying for the user to fill out the form and submit it.

A 'name' attribute must also be unique to the form, as this is how the plugin keeps track of all input elements.

However, each group of radio or checkbox elements will share the same 'name' since the value of this grouping represents a single piece of the form data.

Apart from required itself and equal To, all validation methods declare an element valid when it has no value at all.

That way an email field is optional unless required is specified.

Displaying error messages before the user had the chance to even type something is not helpful.