WebSite X5Help Center

 
Lucas F.
Lucas F.
User

Dropdown Country Code Phone list  en

Author: Lucas F.
Visited 514, Followers 1, Shared 0  

Hi, i have a contact form on our site where the visitors has to insert their phone number, and what we need is to add a dropdown field where they have to select their telefono country code. (+1, +39, + 34.. etc)...

what are the option i can do this? is it possible to take the country codes from a database table?

can anybody help me on this?

thanks.

Posted on the
1 ANSWERS
Daniel W.
Daniel W.
User
Best User of the month EN

The country code list is very long if all countries are to be listed, which raises the question of whether this can be expected of visitors.

With a database you would probably have to integrate the list using Javascript and also use PHP or NodeJS on the server. But I'm not a Javascript expert, so the Javascript experts would have to estimate how much effort would be involved.

If the number of countries is small, this could also be done manually using a small drop-down list so that visitors don't have to scroll endlessly to find their country.

The question is whether it wouldn't be easier for visitors if they only had to enter the numbers in an input field.

With a number list, visitors have to know the country code, otherwise they would not be able to select numbers from a list.

These are my thoughts on a country code list.

If you really want a very long country code list with a database connection, then wait for the Javascript experts.

Read more
Posted on the from Daniel W.