diff --git a/entries/normalizer.xml b/entries/normalizer.xml index 6310687..936e455 100644 --- a/entries/normalizer.xml +++ b/entries/normalizer.xml @@ -8,10 +8,13 @@ Prepares/transforms the elements value for validation. - Note that this method: -

Doesn't change the elements' value, it only changes the value used for validation.

-

Gets the value passed as argument, and "this" within it references the corresponding DOMElement.

-

Needs to return a String value, otherwise it will throw a TypeError exception.

+

Transform the value of an element and the result for validation instead of the initial value. The normalizer can be defined global to all elements or local to only one element. With that said, the local normalizer will only run for the element for which it was defined. The global normalizer will run for all validated elements. This normalizer can be then overrided for each element, as needed, by attaching one to it. This way only the local one will run for that element, and the global one will run for others.

+

Note that this method:

+
Makes "field" required and use a normalizer to trim its value before validating @@ -38,21 +41,67 @@ $( "#myform" ).validate( { ]]> - - Makes "url" required and use a normalizer to append 'http://', if not present, to the value of the "url" element before validating + + Makes "url" required and use a normalizer to append 'http://', if not present, to the value of the "url" element before validating + +url: + +
+ +]]> +
+ + + Using a global normalizer in conjunction with a local one Required: + +

diff --git a/entries/validate.xml b/entries/validate.xml index 2079975..6012dad 100644 --- a/entries/validate.xml +++ b/entries/validate.xml @@ -212,6 +212,13 @@ + + + Prepares/transforms the elements value for validation. + See normalizer docs for more details. + + + Validate the form on submit. Set to false to use only other events for validation.