Postcode Anywhere Address Lookup Callback

The new Postcode Anywhere configurator is easy to setup, mapping their address fields to your form fields is as easy as using a nice simple interface – the greatest of ease!

Trouble is with this way, there is no way of using a callback i.e when i have successfully selected an address from the select element, i might want to run a function, say to show extra fields (the address ones in fact).

By default, i have my address fields hidden, it makes for a tidier looking form, when the user enters their postcode, a select appears, the correct address is chosen, the select disappears and the address fields are populated and shown…

So, i used jQuery live to attach a handler to the select:

[code]
$(‘#pcaSelectUM58’).live(‘click’, function()
{
$(‘#addressFields’).css({‘display’:’table’});
});
[/code]

Simples really but would be nice if there were “native” callback functions we could use.




5 Comments

Hi Stuart,

We picked up your post, and are happy to confirm that we do have a callback function you can use to trigger such events! Sorry you hadn’t managed to locate it previously. You can use it like this:

function CapturePlusCallback(uid, response) {
// CODE TO SHOW YOUR FIELDS HERE
}

Does that help? Any queries please feel free to contact us on our support@ email address.

Thanks
Alex Schofield
Postcode Anywhere

Hi Alex,

Thanks for replying, are these functions available to me even though i’m using the address finder (from an entered postcode), i’m not the capture+ version..?

So should i be using the CapturePlus+ version instead so i can use proper callback functions? Seems i cannot with the way i have used the address lookup.

Ah ok sorry, I had assumed you were using Capture+. I’m afraid the older style address finders from a Postcode do not have any similar callback functions due to the way the lookups work.

If Capture+ isn’t appropriate for you, then you’ll probably need to use our API methods properly. If you look at our documentation pages (http://www.postcodeanywhere.co.uk/address-validation/api/) then the ‘Find’ and ‘RetrieveById’ methods will replicate the style of lookup you’re doing currently with our web clients.

Thanks
Alex

Ah that was you! awesome. It’s helped us alot over the years as historically we haven’t really had anyone that does PHP. If there’s any help we can provide in the future just let us know!

Thanks
Alex.

Leave a Reply

Your email address will not be published. Required fields are marked *