Identify cities or other subjects

Asked

Viewed 37 times

0

Good afternoon, my friends. I’m creating a website for a company and I’m having a little doubt. Can anyone tell me how do I get the site to "auto complete" user cities? EX: in the state I select that I live in São Paulo, and automatically that of cities, shows me only the cities of São Paulo. If I haven’t been clear enough, forgive me.

  • Check this link: http://www.daviferreira.com/posts/populando-selects-de-cidades-estados-ajax-php-e-jquery. It has what you’re looking for :)

1 answer

0

You can create a file that makes only one return in a giant array with all names or directly query an API

  1. City Json to use with the file
  2. API with city acronyms

To popular the other select make a request with the value of the first input and fill the second with the returned values.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.