I want to do the folowing thing, here is simple select, that gets info from db.I have one db that have id/city/people.SO this is like some example selects
Select1|Select2|
City1 |2
City2 |Poeple2
City3 |People3
City4 |People1
City5 |PopleFromFirstCity
Here is what i want to do, when i select some city from the first select, i want in the second select that is Select2 the output to be auto changet to what i picket in the first, so if i pick City1, the second select to have PeopleFromFirstCity and People1
For first selection make this:
For output from selection2 make div:
Now make second table table2 which contain peoples, and make .js file
Implement to your file where is selection 1 this js file.
And now make selection 2:
How you have 2 tables. table1 for cities second table2 for peoples. When you update your database for example from admin panel, u need to update 2 tables. for peoples and for cities.
For table 1 need to contain: id, city… Table 2 need to contain id,peoples, city_id.
Code isn’t tested.