Anyone know how to autofill country in a form?

  • 30 November 2016
  • 5 replies
  • 28 views

Please provide me a code for auto fill country in form.


5 replies

Userlevel 7
Badge +3

Hi @Martina,

As you’ve mentioned, autofilling the visitor’s country requires some custom coding but it also requires an API service that can translate the visitor’s IP data and provide back the country.

Depending on the API you use, the implementation would be slightly different.

Best,
Hristian

I want similar to below link

http://phppot.com/demo/jquery-ajax-autocomplete-country-example/

Thank you,

Martina Maruche

Executive IT

Userlevel 7
Badge +3

The example you’ve provided shows Autocomplete which is different than Autofill.

Either way, you would need a developer to set it up as this would be a custom script.

I am a developer so u can explain me (Know php, html, ajax etc).

I just want to know how i can rewrite id=“search-box” though I have name=“gaCountry”

Thank you,

Martina Maruche

Executive IT

Userlevel 7
Badge +3

Hi Martina,

Since you are a developer, you are going to have to adjust your script to use the field you have on your form.

Each field in your form has its own ID. If in your case it’s gaCountry use that in the script.

Best,
Hristian

Reply