• 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

mysql_result is defined but mysql_free_result warns it expected a resource

PHP-Sort array based on another array?

PHPExcel How to set conditional formatting to change cell background color based on cells values

Laravel - Browser displays message again when I press back button

how to get the header value, if we don't know the value because the value is random from the server

How to create a video stream from a single dynamic image in PHP

How to get total pages of PDF with FPDF?

Dynamic dropdown Ajax PHP request

Post Form Data To phpmyadmin Database

Laravel/docker-compose/redis - Class 'Redis' not found

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Can't find vendor/autoload.php for Ratchet

PHPExcel file download using AJAX call

Fatal error: [] operator not supported for strings

Cannot pass null argument when using type hinting

About Contact Privacy policy Terms and conditions