intl tel input example jquery

Solutions on MaxInterview for intl tel input example jquery by the best coders in the world

showing results for - "intl tel input example jquery"
Léopold
25 Sep 2017
1<!DOCTYPE html>
2<html>
3 
4<head>
5  <title>International telephone input with country flags and dial codes using jQuery - Clue Mediator</title>
6  <!-- CSS -->
7  <link href='https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' rel='stylesheet' type='text/css'>
8  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.3/css/intlTelInput.min.css" />
9  <!-- JS -->
10  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
11  <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.3/js/intlTelInput.min.js"></script>
12  <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.3/js/utils.min.js"></script>
13</head>
14 
15<body>
16  <div class="container">
17    <div class="col-md-8 mt-4">
18      <h5>International telephone input with country flags and dial codes using jQuery - <a href="https://www.cluemediator.com/" target="_blank" rel="noopener noreferrer">Clue Mediator</a></h5>
19      <input type="text" id="phone" />
20    </div>
21  </div>
22 
23  <script>
24    var input = document.querySelector("#phone");
25    intlTelInput(input, {
26      initialCountry: "auto",
27      geoIpLookup: function (success, failure) {
28        $.get("https://ipinfo.io", function () { }, "jsonp").always(function (resp) {
29          var countryCode = (resp && resp.country) ? resp.country : "us";
30          success(countryCode);
31        });
32      },
33    });
34  </script>
35</body>
36 
37</html>
38