• 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 find phpcs current default standard

Star and Half Star Rating in Laravel

Symfony 4: "Autowire: you should configure its value explicitly."

PHP file_get_contents function

Laravel Multi-language routes without prefix

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

Distribute array row data to make multiple new rows

php script to delete files older than 24 hrs, deletes all files

wp_remote_get() not passing authentication

Parameter is not sent to Laravel route in Ajax

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

OAuth2 Token PHP

Add 2 Webcam in one page with WebcamJS

PHP array stringify

PHP drop down list using array's and foreach (else and for) code

About Contact Privacy policy Terms and conditions