LiveView Form Bindings

Let's learn how form binding works in Phoenix.

We already know that LiveView uses annotations called bindings to tie live views to events using platform JavaScript. This lesson demonstrated the use of two form bindings: phx-submit for submitting a form and phx-change for form validations.

LiveView also offers bindings to control how often, and under what circumstances, LiveView JavaScript emits form events. These bindings can disable form submission and debounce, or slow down, form change events. These bindings help you provide sane user experiences on the frontend and ensure less unnecessary load on the backend.

Let’s take a brief look at these bindings and how they work.

How to submit and disable a form

...