Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- POSTCODE: <input type="text" name="adv_postcode" id="adv_postcode" class="addressfields"/>
- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJcNfHosSZtteJp9jndsH8pJ4YZlBMHTA&libraries=places&sensor=false&callback=initialize" async defer >
- function initialize() {
- $('#adv_postcode').each(function () {
- initialize2(this);
- });
- }
- function initialize2(elementID) {
- var options = {
- componentRestrictions: {
- country: 'uk'
- }
- };
- var autocomplete_element = new google.maps.places.Autocomplete(elementID, options);
- autocomplete_element.addListener('place_changed', function () {
- elementID.value = fillInAddress(autocomplete_element);
- });
- }
Add Comment
Please, Sign In to add comment