GigCityElixir 2023 - Andrew Ek
summary
LiveView forms evolve through concrete iterations: basic submit-only validation, browser semantic inputs, then phx-change="validate" for live validation, the newer LiveView form struct that tracks touched fields and survives disconnects, and HTML attributes like phx-debounce="blur" to reduce noisy feedback. The demo uses phx-disable-with to prevent double submits and a virtual field that turns dollars into cents before saving. Everything works but each validate callback costs a server round trip, so latency-sensitive or ultra-polished UIs may need client-side JS.
AI-written summary · about
chapters (15)
- 0:00Introduction and thesis
- 3:02Form best practices overview
- 7:30Variation one: Basic form
- 12:08Variation two: Semantic HTML
- 16:06Variation two: Improvements and issues
- 18:55Variation three: Real-time validation
- 21:22Variation three: Disconnect handling
- 22:50Variation four: Form binding
- 27:03Variation four: Limitations
- 29:13Variation five: Accessibility and HTML
- 32:02Debounce and user experience
- 34:11Virtual fields and Ecto
- 35:54LiveView limitations and trade-offs
- 37:14When to use LiveView for forms
- 38:40Key takeaways and conclusion
