• 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

Filter WooCommerce related products by Polylang language

Split comma separated value from table column into rows using mysql?

How can I access an array/object?

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

WHM Enabling mod_rewrite

Adding the custom page with add_menu_page function on Wordpress

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Woocommerce Checkout - Add conditional field required if one field is filled

Dropdown with current value from Mysql

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

PHP array slice from position + attempt to return fixed number of items

Not able to access model in the controller mautic

phpseclib 2.0 can not use Composer to create autoload

Target class controller does not exist - Laravel 8

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

About Contact Privacy policy Terms and conditions