• 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

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

Vimeo API: how to save a vimeo into a subfolder?

Laravel Livewire: jQuery not working in child component loaded via @if statement

Laravel MSSQL Server Connection not working

PHP Fatal error: Class not found - PHPUnit

Pass an image through AJAX [duplicate]

401 Unauthorized only occurring on some pages in Laravel 8

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

How Can I Do LIMIT 1, 2 In WP_Query

Create tags in laravel post publishing

How to send image,audio or video through the WhatsApp API - PHP

PHPSpreadsheet - How Do I Use Auto Migration Tool

How to assert parameter attribute sub-structures in PHPUnit mock call expectations

php mysql + create a friend request system

What is the difference between client-side and server-side programming?

About Contact Privacy policy Terms and conditions