• 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

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

how to hide previous markers when new markers added in google map javascript api

How to execute sql code based on fetch array

How in Laravel run JavaScript code stored in php variable?

Converting array to string and then back in PHP

Adding reCAPTCHA v2 into my PHP file

Not able to override collapsible.js in magento 2

Live search query using JS and PHP for QA forum

OAuth2 Token PHP

How to get values inside <![CDATA[values]] > using php DOM?

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

Woocommerce product attributes with hierarchy like categories

HTML and PHP in one file

Why does using salted hash on python and php give me different results?

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

About Contact Privacy policy Terms and conditions