# Put `phx-change` inputs inside a form

Put every input with its own `phx-change` binding inside a form. Outside one, the markup looks wired, but LiveView will not send the event.

```heex
<!-- Broken: this change never reaches handle_event/3 -->
<input name="query" phx-change="search" />

<!-- Fixed: prefer the binding on the form -->
<form id="search" phx-change="search">
  <input name="query" />
</form>
```

Putting `phx-change` on the form sends all of its fields when any input changes. The callback also receives `_target`, so it can identify the field that triggered the event.

An individual input may have its own `phx-change` when it needs a separate event or `phx-target`. It still has to live inside a form.

If a LiveView input appears to ignore typing without raising or logging anything, check its form ancestor before debugging the handler.

[Phoenix LiveView form bindings](https://hexdocs.pm/phoenix_live_view/form-bindings.html)


---

Created by: almirsarajcic
Date: September 11, 2026
URL: https://elixirdrops.net/d/pEqwfUMa
