• 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 youtube api data to print in toolset metabox using a button click before save-post

Store / Website Column in Magento 2 Admin Grid - Custom Module

AJAX call fails with SyntaxError: Unexpected end of JSON input

Change the alert text on add to cart action without selected variation in Woocommerce

How to retrieve Active Directory group policy maximum password age using LDAP

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

How to access a var with "-" in PHP [duplicate]

Exact alternate to mcrypt_encrypt in PHP 7.2

Laravel phpunit test failing authorization

Add New Parameter to Existing URL using htaccess

How in Laravel run JavaScript code stored in php variable?

Where do I need to place a hook for phpunit?

How can I get a div content in php

Cannot connect to own websocket server when on secured domain

PHP contact form configuration [duplicate]

About Contact Privacy policy Terms and conditions