• 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

Change user role if checkout custom checkbox is checked in WooCommerce

protect images from being copied

Laravel Pagination links() not working

Facebook PHP SDK - will not logout properly

GuzzleHttp Hangs When Using Localhost

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

Prestashop webservice API creating cart rules

How to use PHPCBF to fix one issue at a time?

VB.NET WebRequest with PHP POST

how to make my own auto increment in php?

How to keep value of selected value after form submission?

Search for array row with specific column value and return another value from qualifying row

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

Two buttons one form

About Contact Privacy policy Terms and conditions