• 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

PHP returning an error message and false

GA4 custom event from server side, can someone tell me how i can do the following code in php?

Passing a boolean value from checkbox in Laravel form

Using Associative arrays

Creating live search with AJAX and CodeIgniter

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Laravel: Create morphs() relationship nullable

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Xdebug can't connect back to Docker host

Parameter is not sent to Laravel route in Ajax

PHP file_get_contents function

How to find the date a user created their Google account

How to use React Router with Laravel?

How to get AJAX to post on second page?

Laravel Unknown Column 'updated_at'

About Contact Privacy policy Terms and conditions