This code is inside a form, that is already being handled with a def handle_event("validate", function. However, my issue is that I’d like to change the UI on the form based on the user selecting a value froma HTML select element. I’d like to change in what currency the amount that the user owes, is shown.
So far, I am able to change the currency using the phx-click no problem, however, with select this creates the changes when the dropdown is clicked and not when the user selects a value (what I’m looking for).
I’ve been hacking at this a couple of days with no luck. Any suggestions / pointers are welcome.
To handle form changes and submissions, use the phx-change and phx-submit events. In general, it is preferred to handle input changes at the form level, where all form fields are passed to the LiveView’s callback given any single input change.
Please take a look at the example code in that doc page. I think it’s a good reference.