• 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

Limit login attempts in Laravel 5.7

Laravel Sanctum CSRF not authenticating

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

PHP code for generating decent-looking coupon codes (mix of letters and numbers)

Converting IPv6 to IPv4 address in PHP

Xdebug in Laravel is not working with VSCode

How to make dot match newline characters using regular expressions

Timber: Single post pagination does not work (wp_link_pages)

Convert PHP array into HTML tag attributes separated by spaces

How to make Canonicals with PHP

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

Having trouble with PDO queries (Notice: Undefined index)

Installing Composer - Internal Error

Where do I need to place a hook for phpunit?

wp_remote_get() not passing authentication

About Contact Privacy policy Terms and conditions