From the course: Building Great Forms with HTML and CSS

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Auto-populating city and state

Auto-populating city and state

From the course: Building Great Forms with HTML and CSS

Start my 1-month free trial

Auto-populating city and state

- [Instructor] We're going to improve the functionality of our form even more by making the zip code field a little bit smarter. Most forms that ask for addresses on web forms are going to ask you for your city, state, and zip code, or city and post code outside of the US. But the city and state are really redundant fields when we have the zip code information, or at least they can be, because you can infer the city and state from a correctly entered zip code. So this is the kind of thing that computers are really good at. You'll notice that we ask for the zip code first, and the reason that we do that is because when the user enters their zip code, we're going to pre-populate the city and state fields with the information that they entered. So this is going to be great for usability. So in order to add this functionality, we're going to be using Ziptastic, and Ziptastic has both free and paid plans. The free plan is…

Contents