Collecting Several Validation Errors
Independent input errors can be reported together when each check has sufficient valid data to run.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Trace two different fields
A form can reject a negative quantity and require a missing label in the same response. A numeric comparison should still wait until its own text field was parsed. Composed validators make such prerequisite relationships visible.
Keep the association
Attach each reason to the corresponding field rather than returning a flat sentence a caller must parse. A decision result with reasons provides a stable interface for display and tests.[1]