Last active
January 27, 2024 22:03
-
-
Save chrisgalard/9987dba6c2c0374fed7ba5227e83b322 to your computer and use it in GitHub Desktop.
These snippets of code will help you to add an international country code dropdown to your phone fields. Just add a normal Clickfunnels phone field and the code will do the rest!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
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 --> |
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 ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @chrisknowscode, how can i add the phone # validation back in? I'm getting a lot of fake phone numbers on CF