• 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

Google Calendar API batch request PHP

PHP only Hit Counter?

AJAX call fails with SyntaxError: Unexpected end of JSON input

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

Call authenticate manually in router middleware

How to convert binary string to normal string in php

Get latest Tweets - What API

How to Make Laravel Eloquent "IN" Query?

Custom API and cunsuming in php?

How to redirect to another page after n seconds in wordpress without using javascript?

Google Gmail API - How to login programatically?

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

php mysql + create a friend request system

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

About Contact Privacy policy Terms and conditions