I am trying to create an input box for users to type in their address. But is it possible to have a drop down of already existing addresses in the database for the user to choose from and at the same time allow them to type their own address if it’s not listed?
I hope this makes sense?
You could pull the email addresses from the database, and use them to build a list of option tags inside your select tag. Add another option tag at the end of the list that says something like “Input another address”. Then use a bit of javascript that causes a text field to be revealed when the last item in the list is selected.
Make sure the hidden input is revealed by default, and hidden using javascript, so that if javascript is not available, the page will still be usable.