ghl-experts-logo-light
  • CSS AND STYLING

    SCRIPTS AND HACKS

  • Address Auto Complete – Google Places API

    Use the below snippet to have anAuto-Complete Address input powered by google.

    This snippet will fill out the Address Field with the full address, for a script to fill out City, State and Postal/Zip Code separately, use this script:

    Address Auto Complete with All Fields

    Address Auto Complete for Order Forms

    NOTE*:
    You will need a Google Places API key.
    Please Make Sure to Enable the Google Maps API as well as the Google Places API


    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>
    <script>
    var input = document.querySelector('input[name="address"]');
    var options = {
      types: ['address']
    };
    
    autocomplete = new google.maps.places.Autocomplete(input, options);
    autocomplete.setFields(['address_component']);
    autocomplete.addListener('place_changed', fillInAddress);
    function fillInAddress() {
    
      var address = document.querySelector('input[name="address"]')
      var e = document.createEvent('HTMLEvents');
      e.initEvent('input', true, true);
      address.dispatchEvent(e);
      setTimeout(function () {
      	console.log(document.querySelector(".pac-container"))
      	document.querySelector(".pac-container").style.display = "none"
        console.log(document.querySelector(".pac-container"))
      },1000)
    }
    </script>

    Welcome to GHL Expert Tools

    We are still in the process of finalizing all of our trainings and setup instructions. If you need help in the meantime, please join our Facebook Group.

    Join our Facebook Group

    Join our Facebook Group to get support, platform insights, ask questions and receive updates.

    Latest Update

    Visit our changelog page to see our most recent update.

    FOMO

    Capture leads before they leave the page by creating
    entincing offers that create a fear of missing out.

    Affiliate area

    Lorem ipsum dolor sit amet, consectetur adipiscing elit,
    sed do eiusmod tempor incididunt.