• 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 get unique slug to same post-title for other time too?

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

how to remove white space in select 2

php retrieve specific data onclick from database in a list format

Laravel Schedule not sending email

Display a success custom notice after Placing an Order in WooCommerce

array_map triple dimensional array [duplicate]

JQuery content editable div and text box on submit not sending POST

Reorder attribute dropdown terms in Woocommerce single variable products

correct PHP headers for pdf file download

Creating a config file in PHP

Magento 2 - Controller returning blank page

javascript html popup window

CONCAT columns with Laravel 5 eloquent

About Contact Privacy policy Terms and conditions