Auto fill address from Postcode...
Hi there,
A client wishes to add an auto address feature to their form. After entering a postcode they are then given the option to select the street they live in from a drop down menu and then the form is auto completed.
How can I do this in Web From Builder?
Thanks,
M McKenzie
A client wishes to add an auto address feature to their form. After entering a postcode they are then given the option to select the street they live in from a drop down menu and then the form is auto completed.
How can I do this in Web From Builder?
Thanks,
M McKenzie
Hi Martin,
It would take a php script to do this. Do they want a limited list or unlimited list?
It would take a php script to do this. Do they want a limited list or unlimited list?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
Martin McKenzie wrote:
Hi there,
A client wishes to add an auto address feature to their form. After entering a postcode they are then given the option to select the street they live in from a drop down menu and then the form is auto completed.
How can I do this in Web From Builder?
Hi there,
A client wishes to add an auto address feature to their form. After entering a postcode they are then given the option to select the street they live in from a drop down menu and then the form is auto completed.
How can I do this in Web From Builder?
Hi Martin,
I recently tackled a small version of your task.
You need a number of things to do this.
#1. The right database - which has post codes and a list of all the streets within that post code. No suggestion, they do exist, GPS units obviously use data tables that include the requisite data, but I've never had my hands on one of them.
The zipcode databases I've used were more of a reverse lookup function where you go from the zip code to get city, state, and phone area code, (or validate same) and maybe map a distance based on the post code centroid contained in the database as the post code's latitude and longitude. Plus the premium versions of these databases contain some socio-economic demographic data per post code.
#2. You would need to write a Javascript AJAX call that is triggered by an event taking place in the form - onchange or lostfocus or onkeyup, something like that.
#3. The AJAX request runs (and passes along the user's selected postcode - maybe as a URL parameter) to a PHP page that runs a sql query that basically says "SELECT `myStreets` FROM `myDatabase` WHERE `myPostcode` = '" . $_GET['myPostCode'] . "';
The query returns your list of streets - the PHP code packs it into XML, sets up an XML header, then echoes the XML page back to the xmlHttpRequest which parses the array of XML nodes and injects it into the innerHTML of the select element.
Here's a JavaScript function I wrote that catches the returning XML and stuffs it into a dropdown box's option list. .
function loadData()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200)
{
var svcXML = xmlhttp.responseXML.documentElement.getElementsByTagName("services");
var myOptions = "<option value=''>Select a Service</option>";
for(i=0; i < svcXML.length; i++)
{
var sdElement = svcXML[i].getElementsByTagName("shortdesc");
myOptions += "<option value='" + sdElement[0].firstChild.nodeValue + "'>" + sdElement[0].firstChild.nodeValue; + "</option>";
}
document.getElementById("description").innerHTML = myOptions;
}
}
Hope this helps,
Gordon
Hi Eric Rohloff/gllincoln
Thanks for taking the time to reply much appreciated!
I was hoping to use this plugin https://craftyclicks.co.uk/ in the Coffee Cup Web Form Builder but not sure how to combine them both in the same form.
Cheers,
Martin
Thanks for taking the time to reply much appreciated!
I was hoping to use this plugin https://craftyclicks.co.uk/ in the Coffee Cup Web Form Builder but not sure how to combine them both in the same form.
Cheers,
Martin
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.