State & Data

Forms and validation

Validation should happen close to the input for immediate feedback, and again at the boundary where data is persisted or sent to a server.

  • Keep controllers owned by the screen that created them.
  • Dispose controllers when their owner is disposed.
  • Show actionable validation messages.
  • Disable submission while a save operation is in progress.
  • Do not silently discard invalid fields.
Lesson complete?Use the next lesson to continue the learning path.