It would be useful if the telephone input field included a dropdown with the international codes.
Is this something others would like? If so, could it be included within the form element?
It would be useful if the telephone input field included a dropdown with the international codes.
Is this something others would like? If so, could it be included within the form element?
Personally, I use this:
Its as easy as linking the cdn as an external js file:
Then the following js (this will look up the users ip location and automatically add the country):
const phoneInput = document.querySelector("#phone");
window.intlTelInput(phoneInput, {
initialCountry: "auto",
geoIpLookup: (success, failure) => {
fetch("https://ipapi.co/json")
.then(res => res.json())
.then(data => success(data.country_code))
.catch(() => failure());
},
loadUtils: () => import("/intl-tel-input/js/utils.js?v=c86632449f1b")
});
Thanks. But I don’t see how to use this with a Bootstrap Studio form.
Add the script link and code as above, and give the telephone input an id = phone
The script will do the rest