Answer the question
In order to leave comments, you need to log in
Javascript + selector + Database?
There are 2 selectors:
1) Countries
2) Cities
There are two tables in Mysql:
1) Countries, each with its own unique ID
2) Cities that are related to countries by ID
Now, how to unload them from the database into selectors?
Answer the question
In order to leave comments, you need to log in
In the first country selector, by changing, you make an Ajax query to the city table, filtering by country id, insert the received data into the second select
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question