A naive question on `phx-change` - every single letter’s change will cause a server round trip?

About the phx-change event, the doc says that:

where all form fields are passed to the LiveView's callback given any single input change

form-bindings
My questions are:
Whether every single letter’s change will cause a server round trip?
When there is an database operation for a form change, will there also be quite much database operations when the form changes a lot?

2 Likes

Hi :wave:

You can limit the number of events sent to the server with phx-throttle or only sending an event when the input is blurred with phx-debounce="blur".

Here is the documentation.

Hope this helps !

3 Likes

Thanks. This helps a lot!

1 Like