• 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

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

zsh: command not found: php

Confirm Leave on External Links in Wordpress

IlluminateDatabaseQueryException could not find driver [duplicate]

JQuery content editable div and text box on submit not sending POST

How to get variable from JavaScript to PHP [duplicate]

phpseclib 2.0 can not use Composer to create autoload

Laravel Sanctum CSRF not authenticating

Execute only one time and then wait set period of time before executing again

Symfony/Form add attribute based on the data

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

Cannot connect to own websocket server when on secured domain

Results page in other window

JSON Render Issue in Date Object Laravel and PHP 7.4

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

About Contact Privacy policy Terms and conditions