Yup, ajax is the answer...
Postcode lookups are usually in the first examples section of any good ajax book.
Basic theory is:
register an onKeyPress event handler on the input to call a function - say keypressed
function keypressed() {
if (ourtimer) window.clearTimeout(ourtimer);
ourtimer = window.setTimeout(sendreq, 1000);
}
That bit means if they haven't typed anything for a second, send the request (Better than sending a request after every single keypress).
function sendreq() {
// Create XmlHttpRequest object, and do the request. Send the partial postcode as a param
// Set the callback for it to reqcallback - this'll get called when we get data back
}
function reqcallback() {
// Here you've got the data from the server. Now use some DOM goodness to show the user
}
Obviously then you need some server side PHP for example to handle the request, and return things.
I'd shell out for a good ajax book, or of course pay someone to do it
