Fields of form disappearing after live view reload

Your form inputs aren’t referencing any value, so when they are re-rendered they aren’t populated with a value. It’s for this reason that I basically always use changesets for my live view forms since it makes it easy to get the correct state on the form fields. If you wish to do it manually you can, you’ll want to do something like text_input :params, :city, id: "city", value: @form_state.city. Then on search-form submit you need to set form_state based on the submitted form values.

6 Likes