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:
-
Has been available since version 1.15.0
-
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
.
-
For versions between 1.15.0
and 1.17.0
, it must return a string value. And as of 1.17.1
, it can return any value including null
and undefined
.