Hello folks,
I am a young webdeveloper from Germany.
There is this technology used in this great website that doesn't stop amusing me, I was just hoping someone could cypher the technology behind it and perhaps reveal it is done with the help of some freely available Library

the link to this DSL Internet provider company is:

http://www.alice-dsl.de/tavp/ooPreAction1.do?ka=pk&prod=fun&dsl_tariff=flat&phone=&dsl_speed=&iptv=no


just insert this postal zip code in there to test the service: 68161
that is a German Zip coad for the city Mannheim. As soon as you type in this post code, the fields of
cheers

This is actually pretty simple to achieve. What you need is a simple event-listener that listens to onchange of the text-box. If the textbox contains 5-chars, and their all numbers fire a ajax-request to a server to ask for the postal-address. The problem is that you need a db of postal-addresses.

The code to do the client-side-scripting can be made like this using mootools:

var sentData = "";
window.addEvent('domready', function(){
    $('postalcode').addEvent('keyup', function(event){
        var e = new Event(event);
        e.target = $(e.target);
        e.target.set('value', e.target.get('value').trim().replace(/[^0-9]/g, '').substring(0, 5));
        if(e.target.get('value').length == 5 && e.target.get('value') != sentData)
        {
            sentData = e.target.value;
            var req = new Request.JSON({
                method: 'post',
                data: 'zipcode=' + e.target.value,
                url: 'YOUR_BACKEND_URL'
            });
            req.addEvent('success', function(result) {
                $('postaladdress').set('value', result.postaddress);
            });
            req.send();
        }
    });
});

but thats the problem, where do I get the required data from, I mean a library or an API or something. . .
with what am I going to validate the data input in the field?

I think eather you have to build you're own DB, or try to look for some public german service that supplies this. Google might be your friend here. Try the post-handle-company in germany (if there is one that is official, if not, try the lot).

the problem is DHL does provide something like that, but like everything else in germany, it is NOT free!
rather it is pretty expensive!
I am looking for something more easy, and there has to be a way, because I am pretty sure the website i linked to earlier doesn't pay for the service!
but I have been wrong before!
how do you guys do it accross the atlantic??

the problem is DHL does provide something like that, but like everything else in germany, it is NOT free!
rather it is pretty expensive!
I am looking for something more easy, and there has to be a way, because I am pretty sure the website i linked to earlier doesn't pay for the service!
but I have been wrong before!
how do you guys do it accross the atlantic??

I'm just north of you. Norway :-P

But I'dd just make my own DB. Start with placec you know, and if the place isn't in the DB let the user enter it, then add it for later use. Shouldn't be too dificult.

I only know about UK postcodes in any detail. Full validation is not simple and can only be undertaken by lookup, for which the Post Office will SELL you something called the Postcode Address File - with over 28 million entries!!! The PAF is updated regularly to keep up with several thousand additions/deletions/changes every year.

Validation of UK postcode format is simpler, though still not particularly easy as there are a many exceptions to the general rules.

Validation is discudssed in the this section of the Wilipedia page on UK Pstcodes .

As far as I can see, the format of German PLZ are much easier to validate because they are all-numeric (no alphabetic characters) but finding out whether a particular PLZ exists can only be done by lookup, same as UK postcodes.

I expect that PLZ are subject to regular additions/deletions/changes the same as UK postcodes.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.