• 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

Display a success custom notice after Placing an Order in WooCommerce

AJAX call fails with SyntaxError: Unexpected end of JSON input

Mobile browsers are adding .html to filename on download

advanced custom fields wordpress custom class

PHP password_verify

Implode array with array of glue strings

PHP: How to quickly split a key=value file into associative array

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

How to get variable from JavaScript to PHP [duplicate]

Custom add to cart button URL for specific product in WooCommerce?

enroll_table three field fetch to payment form to create payment field in laravel 5.5

Could not decode a text frame as UTF-8.

What is the function of the (new Date()).getTime() in PHP?

Inserting data into SQL Server Db An Invalid direction was specified

How do I call Validator from a namespace with an already existing Validator class

About Contact Privacy policy Terms and conditions