• 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 Discord OAUTH2 code sample not working

Search for array row with specific column value and return another value from qualifying row

Magento 2 - Controller returning blank page

Is there a way to use Foundry Model for Authentification inside Functional Tests?

Fetch files from next cloud storage and display in Laravel website

How to get page number on dompdf PDF when using "view"

Get sum of arrays inside array

how to identify the web server name of remote host

dockerizing Laravel + vue

Distribute array row data to make multiple new rows

Add Class in html Dynamically in PHP

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

Symfony there are no commands defined in the "make" namespace

Dynamic table in HTML using MySQL and php

Object of class stdClass could not be converted to string error

About Contact Privacy policy Terms and conditions