Answer the question
In order to leave comments, you need to log in
How to select a country, region, city from the database without reloading the page?
Good day, the following problem arose.
It is necessary to make a selection of the Country, Region, City without reloading the page .
I don't understand Ajax, that's why I'm asking for your help.
I use RedBean PHP to work with the database .
DB Countries, regions and cities downloaded. (Link to SQL code)
I would like to make it so that when choosing a country, regions are given only for this country and in the same way for cities.
This is how the form looks like on the site:
I would be glad for any help!
Answer the question
In order to leave comments, you need to log in
There is nothing complicated about AJAX, the principle is explained in detail and with many examples hundreds of times in many articles. Write down what you don't understand.
It can be implemented in the following way:
Track the event of the estate in the html country select, get the id of the selected country and make a request to the server to get all the areas related to this country, build the area select. Do the same when changing the selected area and the selected city.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question