• 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 quarter for future date using Carbon?

php echo remove slashes from url [duplicate]

How to set a domain name with php artisan serve

Laravel insert dynamic input values with radio button

Manage independently the decimal number of the price of each product [duplicate]

echo language construct is discouraged. (PHP)

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

php file upload scanning using clamav, permissions on /tmp/

Symfony process run throws exception - executing on command line works

How do I pass the dynamic output of a php variable or php function to a CSS variable?

WordPress Subquery returns more than 1 row on SELECT

How to get total pages of PDF with FPDF?

Adding reCAPTCHA v2 into my PHP file

GRPC installed successfully on ubuntu but php is looking for it in another folder

Transform array, set each array element with parent key php

About Contact Privacy policy Terms and conditions