• 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

Match single unknown parameter php (Morse-code Regex)

AJAX call fails with SyntaxError: Unexpected end of JSON input

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

How to loop sql table data inside a html table

Add custom text under order details on WooCommerce My account view order pages

Don't show recurring price for WooCommerce subscriptions worth 0$

Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter

unable to load your default controller on Codeigniter

Results page in other window

PHP: convert all UTF-8 characters to HTML entities

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

Adding Multiple Custom Post Types in Wordpress

Prestashop cUrl Login

Laravel 8 Multiple Relationships for Factory

Autoloading classes in PHPUnit using Composer and autoload.php

About Contact Privacy policy Terms and conditions