BarelyFunctional
Idiomatic LiveView dynamic/nested forms
I’m starting to build a multi-step/page ‘wizard’ form, but from these forums and web tutorials, struggling to find the idiomatic way to build a dynamic form.
The simplest use case is:
- User clicks or presses Enter to choose an option from a select,
- Depending on the option another form element is displayed eg another select or radio buttons or a text field.
- Some steps/pages will have forms that have 3-5 elements, each depending on the previous one.
I know this is one of the most basic use cases for LiveView, but I’m struggling to find a simple example.
Can anyone please point to one in these forums or in an online tutorial or put an example up below?
Thanks
Most Liked
f0rest8
The good news is that there is very little to do to update my older blog post mentioned above to 0.16.1:
And making the update further cleans up the code a bit (
).
You can follow the changelog guide and reference the live view docs as well. After the update, you can totally get rid of the templates/person_registration and just render it all in your live view with that wonderful ~H.
Here’s a new updated post with the changes:
Hope it helps ![]()
APB9785
Here are some links that might be helpful:
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









