Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a website with postgis, mapserver & openlayers. On the website you can enter a postal code and then a drivetime isochroon is created.

The problem now is that you can enter anything in the input box. If you enter a postal code that does not exist (or maybe some letters) nothing happens. No isochron is created, which is correct because it is not a valid code.

What I want is that if you enter a not existing postal code I would like to have a pop-up (or something like that) which says: 'this is not an existing postal code, please enter another postal code'

Someone any idea how I can create this?

The website is:

Thanks, Stefan

share|improve this question
up vote 0 down vote accepted

there are some ways to solve your problem. the main solution is that @Kurt Overberg' answer as controlling before sendining any data. the other ways which come to my mind are

  • you can control your respond whether any data return or not. if not empty respond size is approximately 196 B < x < 220 B ....

  • you can use a rest service if your database has your postcode or not. if not you can alert your messega. for postgis you can check out PostGIS RESTful Web Service Framework here.

finally you should check out jQuery MsgBox for your result here...

i hope it helps you...

share|improve this answer

Seems like you'd be better off validating the input using javascript in the browser before sending the data to the web application.

A quick search for "javascript validate postcode netherlands" found:

...hope this helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.