Yes, this is possible. Our recommendation would be to use the q2-select element with Robust Option Content. This would allow you to display a fully formatted address, then when the user selects an option you can dynamically update the other fields in the form to their respective values. This would also keep the form's appearance cohesive with the rest of the app. This could be dynamically done with pure javascript and Jquery, but I recommend using a frontend framework like React.
Answered
Input field address options dynamic from API
I'm currently building out an address change form that will supply the user with suggested addresses. I have an API that will be fed the address as the user types it in and returns 5 to 10 address suggestions, then when the user selects one of the addresses, it will complete the rest of the form.
I was going to investigate using the Dropdown Select component and fill the options with the return from the API or is there a way to use the regular q2-input and display the suggestions below the regular input field?
126 Views
1
Answer
4 years ago
4 years ago
Tags