BuildBot

HTML Over the Wire

Forms and validation

Lesson 3 of 5

The POST round trip has two outcomes — success swaps in the new row, failure re-renders the form fragment with inline errors and a 422 — and htmx 2 needs one config line to swap 422 bodies at all.

What you'll learn

  • Handle the form POST round trip with two outcomes: success and validation failure
  • Re-render the form partial with inline errors, returning 422 Unprocessable Entity
  • Choose hx-target/hx-swap so both outcomes land in the right place
Members only

A free account unlocks this lesson and every other one.

Runnable challenges, knowledge checks, and progress that syncs across your devices. No card needed.

Not sure yet? Try the free lesson first: Hypermedia, not JSON