How to validate Valid USA ZipCode

Pritam Gupta asked on February 22, 2017 23:31

Hello,

Is there any functionality available in Kentico 9 to validate USA zipcode that user enter zipcode than validate that its valid or not.

if there is no functionality available than can you please guid me to resolve this problem in kentico.

Thnaks

Recent Answers


Trevor Fayas answered on February 22, 2017 23:41

It has built in validation that it is a proper format for a zip code, it doesn't check to see if that zip code actually exists.

In order to do that, i would recommend using Google's API

  • http://maps.googleapis.com/maps/api/geocode/xml?address=77379&sensor=true
  • http://maps.googleapis.com/maps/api/geocode/xml?address=00001&sensor=true

you can also use the json

  • http://maps.googleapis.com/maps/api/geocode/json?address=77379&sensor=true
  • http://maps.googleapis.com/maps/api/geocode/json?address=00001&sensor=true

Compare the results on these, should at least be pretty close!

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.