Drop down list with possibility to enter new value instead of list

I’m creating a small website php/mysql.
Let’s say I have in my DB a table with different laptop specifications (brand, cpu, …). When adding a new laptop in a html form, in the brand field for instance, I want to have the option to see all the distinct brands present in the DB and either choose one of them or add a new one.
I am not necessarily looking for a code, maybe an idea.

I have 2 ideas so far:

1. I have a ‘input’ field where to write the brand name and a drop-down list right next to it, so if I choose a brand from the list, using javascript I think, the brand name will be filled in the input field automatically. Not the prettiest solution.

2. I don’t know if there is such an option in html to add brand names somewhere in the code (a little bit like option/select) so when I double click in the input field I can see the list of brands then choose one or just type a new brand in.

3. Your idea/solution…

Source: mysql

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.