-
-
Save chrisgalard/9987dba6c2c0374fed7ba5227e83b322 to your computer and use it in GitHub Desktop.
<!-- | |
International country code selector for Clickfunnels | |
Author: Chris Galard | |
Website: instagram.com/chrisgalard | |
License: You can do whatever you want with this code. We hope it helps you! | |
Want help with funnels & systems to grow your online course sales? | |
Book a call with me: | |
https://growthkingdom.com/results | |
Or DM me on IG: @chrisgalard | |
--> | |
<!-- START: Paste this in your header tracking code --> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/build/css/intlTelInput.min.css"> | |
<style> | |
[data-title='phone-container'] { | |
overflow: visible; | |
} | |
/* Get the phone input to expand to parent element width */ | |
.intl-tel-input { | |
display: block; | |
} | |
/* Avoids Clickfunnels from hiding the flag names */ | |
.intl-tel-input span { | |
display: initial !important; | |
} | |
</style> | |
<!-- END: Paste this in your header tracking code --> | |
<!-- START: Paste this in your footer tracking code --> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/js/intlTelInput.min.js"></script> | |
<script> | |
document.addEventListener('DOMContentLoaded', function () { | |
var submitBtn = $('[href="#submit-form"]'); | |
var phoneInput = $('input[name="phone"]'); | |
// Enabling the phone number selector | |
iti = window.intlTelInput(phoneInput[0], { | |
nationalMode: false | |
}); | |
}); | |
</script> | |
<!-- END: Paste this in your footer tracking code --> |
This looks perfect! But also doesn't save the country code for me which is what I need... Would be amazing if it could format the number on submission.
Can you help me edit this so I can show only the countries that I need?
I would appreciate if you make the cde save the country prefix. Thank you!
Is there a way to get this to work on a popup?
Hey everyone! The code has been updated.
First of all it was simplified so it's less prone to error.
Second, now it saves the country code in the contact profile inside of Clickfunnels.
Third, removed the validation so it doesn't keep your leads from opting in with their email if the phone is incorrect. The code was not allowing people to optin if their phone was incorrect or empty, and this was no bueno.
Let us know if you have any questions!
Hey @chrisknowscode, how can i add the phone # validation back in? I'm getting a lot of fake phone numbers on CF
Hi, It work well! But I have a problem : I'm trying to put a country like FR or BE in the first results instead of US and UK, do you know how to do it ?
Country code doesn't save at profile!