Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:50:24+00:00 2026-06-14T08:50:24+00:00

I want to validate that the postal address filled in by a user is

  • 0

I want to validate that the postal address filled in by a user is correct.

Assuming that we have the fields street, street_number, postal_code, city and country

How can show errors when the user, types in that his country is France and is city is New York?

or

How can I detect that a postal code doesn’t correspond to the city?

Is there a strategy to address this issue with Ruby On Rails or shall I just trust the user entries ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:50:25+00:00Added an answer on June 14, 2026 at 8:50 am

    There are several companies that publish US ZIP code directories, typically not terribly expensive, and some even come with lat/lon data. This is the most common way of validating city and state in the US or North America. Worldwide postal codes to country and city is likely to be a harder problem, or at least a more expensive one.

    Another approach would be to use the Google Maps API, perhaps in conjunction with the data you can get from location-aware browsers (all modern ones). To be honest, it’s been a while since I have used the API, but seem to recall you can get pretty detailed information given a lat/lon. Google now charges for high use of the Maps API, but if your site has even moderate traffic, you’re probably still in the free zone.

    At some level, you’ll have to trust users. I remember a while back we found anomalies in user reported zipcodes in our database — seemed like everyone lived in Beverly Hills, CA. This was around 2000, when the original version of the TV show “90210” was still around — that’s the zipcode :-).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have textbox in my windows phone 7. I want to validate that user
I have an asp:TextBox and I want to validate that the number of characters
I want to validate a registration form that accepts an email address in the
I have a form that validates the email address and I want to be
I have a register script and i want to validate that people have typed
I just want to validate that a Twitter user exists. My code is returning
I have a string and I want to validate that string so that it
I want to validate that the user has entered a comma separated list of
I have a bean object and want to validate its fields using oval validation
in my web application i want to validate that user can enter only digits

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.