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: maps.geodan.nl/reistijden.htm

Thanks, Stefan


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.


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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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