Skip to content

Instantly share code, notes, and snippets.

@maravilhosinga
Created January 6, 2019 15:39
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maravilhosinga/1fbd3dec2cada08976756316fc466ca4 to your computer and use it in GitHub Desktop.
Save maravilhosinga/1fbd3dec2cada08976756316fc466ca4 to your computer and use it in GitHub Desktop.
International Telephone Input - BOOTSTRAP INPUT GROUP
<h1>International Telephone Input - BOOTSTRAP INPUT GROUP</h1>
<form>
<div class="input-group">
<input type="tel" class="form-control">
<span class="input-group-addon">Tel</span>
</div>
<br>
<div class="input-group">
<input type="tel" class="form-control">
<span class="input-group-addon">Tel</span>
</div>
</form>
$("input").intlTelInput({
utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/8.4.6/js/utils.js"
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/8.4.7/js/intlTelInput.js"></script>
body {
margin: 20px;
}
form {
width: 300px;
}
// workaround
.intl-tel-input {
display: table-cell;
}
.intl-tel-input .selected-flag {
z-index: 4;
}
.intl-tel-input .country-list {
z-index: 5;
}
.input-group .intl-tel-input .form-control {
border-top-left-radius: 4px;
border-top-right-radius: 0;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 0;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/8.4.6/css/intlTelInput.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment