TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Address Form With No City State (just Zip Code)

2 点作者 Johngibb大约 14 年前
TL;DR; How do I automatically infer city/state from zip code, and ask for clarification if ambiguous?<p>I'm building a website that needs to collect the user's address, but I absolutely abhor typing in city, state, and zip code. It seems redundant.<p>However, I'm aware that there are sometimes more than one city that corresponds to a single zip code. Apple's checkout page has an interesting solution: when you type in the zip code, they perform an AJAX lookup, and show you the city state if it's not ambiguous, or give you a drop down if it is (see: http://www.lukew.com/ff/content/apple_checkout_zip.gif).<p>Has anyone built something like this? Is there a good database or API available for determining cities and states from a zip code?

4 条评论

matdwyer大约 14 年前
Here is a great post that was posted on here: <a href="http://uxmovement.com/forms/innovative-techniques-to-simplify-sign-ups-and-logins" rel="nofollow">http://uxmovement.com/forms/innovative-techniques-to-simplif...</a><p>And here is the link directly for what you're asking: <a href="http://forumsblogswikis.com/2007/08/15/using-ajax-to-get-city-and-state-from-zip-code/" rel="nofollow">http://forumsblogswikis.com/2007/08/15/using-ajax-to-get-cit...</a><p>Good luck
Ixiaus大约 14 年前
That's silly, many users expect that. What you <i>can</i> do is geolocate their country so they don't have to select their country but other than that I still ask them to type in their city and state...
评论 #2525299 未加载
Johngibb大约 14 年前
PS: Here's the original blog that was the source of the apple image: <a href="http://www.lukew.com/ff/entry.asp?968" rel="nofollow">http://www.lukew.com/ff/entry.asp?968</a>
Johngibb大约 14 年前
Please see <a href="http://gibb-test-address.heroku.com/" rel="nofollow">http://gibb-test-address.heroku.com/</a> for my attempt at solving this.