• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to auto populate preferredCountries from intl-tel-input with db output

javascriptphpdatatablesbootstrap-4intl-tel-input


PHP Snippet 1:

preferedCountries = JSON.parse(data)
iti.destroy();
iti = window.intlTelInput(input, {
    separateDialCode: "true",
    autoHideDialCode: "true",
    autoPlaceholder: "polite",
    preferredCountries: preferedCountries,
    utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/14.0.7/js/utils.js",
    customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
        return "e.g. " + selectedCountryPlaceholder;
    }
});

Related Snippets

how to insert data into select2 search input after scan using qrcode

Converting array to string and then back in PHP

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

How to get monthly wise data in laravel

How to fix Call to undefined method AppModelsTableName::factory?

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

Yii2: How to download backup files using spanjeta/yii2-backup?

how to search for a file with php

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

OAuth2 Token PHP

Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter

Convert every two values of an associative array into key-value pairs

PHP Get value from JSON [duplicate]

Detect a fetch request in PHP

How to remove from a multidimensional array all duplicate elements including the original?

About Contact Privacy policy Terms and conditions