• 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 use extended ASCII instead of unicode in PHP

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

Show Custom Data in Woocommerce Order Details Admin Area

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

Parameter is not sent to Laravel route in Ajax

Composer Warning: openssl extension is missing. How to enable in WAMP

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Server-sent events in PHP (without echo or print)

Additional price based on cart item count in WooCommerce

Symfony run hint kernel.secret parameter not found

How to check user Permissions using Custom Middleware in Laravel

how to sort by a custom appended relation to model

PHP password_verify

PHP Warning: Module already loaded in Unknown on line 0

Access relation of pivot table in Laravel

About Contact Privacy policy Terms and conditions