• 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

Creating a config file in PHP

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

Convert PHP array into HTML tag attributes separated by spaces

protect my blog content

In PHP, which is faster: preg_split or explode?

PHP web3 ERC20 token function call

Get WooCommerce products from specific category

PHP: How to quickly split a key=value file into associative array

php code to send checkbox form results to email

The difference when using if statement true === something() vs something() === true [duplicate]

How to use PHPCBF to fix one issue at a time?

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

Upload a file Using PHP and JavaScript

Insert a DIV after the 6th product only once in WooCommerce category archives

How to show a popup modal in codeIgniter?

About Contact Privacy policy Terms and conditions