form-validation-kit is a small library for handling the validation state of HTML forms.
Single input with a single syncronous validator asserting that input length is an even number.
This form demonstrates the library's capabilities. Each input utilizes different features of the library. Details after the demo.
For demo purposes, the state and its history are visualized for each input. It's not part of the library's functionality
Validation can have the following states. If validator depends on other validators, active state is the state with highest precedence (top to bottom in list below) of all the used validators.
evaluate()
.
Waiting validator to call done()
or error()
.
State is used only with asynchronous validators.To | |||||
---|---|---|---|---|---|
From | VALID | INVALID | QUEUED | ERROR | |
VALID | |||||
INVALID | |||||
QUEUED | |||||
ERROR |
To | |||||
---|---|---|---|---|---|
From | VALID | INVALID | VALIDATING | QUEUED | ERROR |
VALID | |||||
INVALID | |||||
VALIDATING | |||||
QUEUED | |||||
ERROR |