How to disable all country names in dropdown menu in intl-tel-input plugin

1.6k Views Asked by At

I need to disable all country names in dropdown menu of International Telephone Input v17.0.13.

I looking for some "Configuration Options" which will disable country names in drop down menu. I want to leave only all phone dial codes in that dropdown manu.

If "Configuration Options" for disable all country names in dropdown menu do not exist please tell me how I can do it in a different way?

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Basic Tutorial</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/css/intlTelInput.css">
      
    <style>
    h1, p{
        text-align: center;
    }
    .iti__country-list {
        min-width: 200px;
        color: black;
    }
    .iti__dial-code {
        color: black; /*#999*/
    }
    .iti--separate-dial-code .iti__selected-flag {
        background-color: rgba(0, 0, 0, 0.05); 
        color: black;
    }
    </style>
</head>
<body>
    <h1>Hello, world!</h1>
    <div class="container-fluid">
        <p class="heading">Basic Tutorial intlTelInput</p>
        <form method="POST" class="form" data-class_data='1'>
            <div class="form-group row row-box">
                <div class="col-md-8 offset-md-4 col-box">
                    <div class="has-icon input">
                        <input class="form-control text" type="text" data-placeholder="true" id="phone" value="">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/js/intlTelInput-jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/2.0.10/lib/libphonenumber/build/isValidNumber.js"></script>
      
    <script type='text/javascript'>   
    $(document).ready(function() {
        $("#phone").intlTelInput({
            //Configuration Options
            utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/js/utils.js",
            allowDropdown: true,
            autoPlaceholder: "aggressive",
            initialCountry: "auto",
            separateDialCode: true,
            initialCountry: "us",
        });
    });
    </script><script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-DrT5NfxfbHvMHux31Lkhxg42LY6of8TaYyK50jnxRnM=" crossorigin="anonymous"></script>
      
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+YQ4JLhjyBLPDQt//I+STsc9iw4uQqACwlvpslubQzn4u2UU2UFM80nGisd026JF" crossorigin="anonymous"></script>
    
</body>
</html>

.

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Basic Tutorial</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/css/intlTelInput.css">
      
    <style>
    h1, p{
        text-align: center;
    }
    .iti__country-list {
        min-width: 200px;
        color: black;
    }
    .iti__dial-code {
        color: black; /*#999*/
    }
    .iti--separate-dial-code .iti__selected-flag {
        background-color: rgba(0, 0, 0, 0.05); 
        color: black;
    }
    </style>
</head>
<body>
    <h1>Hello, world!</h1>
    <div class="container-fluid">
        <p class="heading">Basic Tutorial intlTelInput</p>
        <form method="POST" class="form" data-class_data='1'>
            <div class="form-group row row-box">
                <div class="col-md-8 offset-md-4 col-box">
                    <div class="has-icon input">
                        <input class="form-control text" type="text" data-placeholder="true" id="phone" value="">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/js/intlTelInput-jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/2.0.10/lib/libphonenumber/build/isValidNumber.js"></script>
      
    <script type='text/javascript'>   
    $(document).ready(function() {
        $("#phone").intlTelInput({
            //Configuration Options
            utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.13/js/utils.js",
            allowDropdown: true,
            autoPlaceholder: "aggressive",
            initialCountry: "auto",
            separateDialCode: true,
            initialCountry: "us",
        });
    });
    </script><script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-DrT5NfxfbHvMHux31Lkhxg42LY6of8TaYyK50jnxRnM=" crossorigin="anonymous"></script>
      
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+YQ4JLhjyBLPDQt//I+STsc9iw4uQqACwlvpslubQzn4u2UU2UFM80nGisd026JF" crossorigin="anonymous"></script>
    
</body>
</html>
0

There are 0 best solutions below