• 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

onKeyUp event calculation not working on the following rows from php generated forms except the first one

Webscraping Symfony/Panther: Can't get HTML

Remove product downloads section in woocommerce email notifications

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

Increase value by 1 on button click

PHP date() with timezone?

Php - Sum up the numbers in an array one by one

How to insert Google Adsense Code in PHP script?

how to make my own auto increment in php?

echo language construct is discouraged. (PHP)

Yii Ajax Submit button

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

PHP DOTENV unable to load env vars

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

Only on Firefox "Loading failed for the <script> with source"

About Contact Privacy policy Terms and conditions