Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Contact form address autofill?


For one of my client websites, the customer has requested an 'autofill' segment for addresses, based on location. I wondered if there were any existing plugins or any advice on how to do this in the squarespace form. I've strong familiarity with HTML and CSS, but not so much with Javascript and other languages.

I've come across this online, but I'm unsure if it can be implemented on Squarespace...https://www.solodev.com/blog/web-design/adding-an-auto-complete-address-field-to-your-forms.stml

Thanks in advance.

Edited by graphicpressryan
Initial Revision

Share this post

Link to post

1 answer to this question

Recommended Posts

  • 0

Hi @rjnicholds, GeoIP service technologies can help you access your visitors' locations based on their IPs.

When it comes to autofill segments for address regarding visitors' physical location, I would suggest GeoLocation API. The API reveals a visitor's country, state, and city with Javascript code and simple variables. You don't have to code yourself. Simply drag and drop Javascript they provided. It will auto-select drop downs and auto-populate form input boxes with location information. 

Please see sample code. Hope it helps!

geotargetly_country_name(); //gets visitor country name
geotargetly_country_code(); //gets visitor country code
geotargetly_region_name(); //gets visitor Region/State or state name
geotargetly_region_code(); //gets visitor Region/State or state code
geotargetly_city_name(); // gets visitor city name
geotargetly_lat(); // gets visitor latitude
geotargetly_lng(); // gets visitor longitude 
geotargetly_ip(); // gets visitor IP address

geotargetly_loaded(); // gets called when data is available


function geotargetly_loaded(){
  var country_name = geotargetly_country_name();
  if (country_name == "United States"){
      //do something


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...