• 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

How to get unique slug to same post-title for other time too?

Zig-zag scan an N x N array

Session timeout in Yii2

TesseractOCR not working for Laravel

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

How to add a custom field to all Woocommerce attribute terms using add_action

How to pass security cloudflare server with php curl

How to submit a form when page loads using JavaScript?

zsh: command not found: php

How to map the two arrays with a duplicate value?

str_replace or preg_replace random number from string

yii2 and mssql insert varbinary into model

PHP: Telegram Bot: Insert line break to text message

Remove country code from phone number?

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

About Contact Privacy policy Terms and conditions