• 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

HTML + PHP + PHPMAILER

Laravel websockets AWS EC2 - Connection failed

Creating live search with AJAX and CodeIgniter

Check if user online laravel

How to test a php login connected to a mysql db through xampp?

Live search query using JS and PHP for QA forum

Add and update products to session cart in Laravel

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

Alert message after submitting form in PHP

Yii2 redirecting to previous page after login

Converting array to string and then back in PHP

How to edit Records using CodeIgniter

If you intend you use SMTP, add your SMTP Code after this Line

I can't delete my image when it is liked because of the foreign key in mysql

Chunk and transpose a flat array into rows with a specific number of columns

About Contact Privacy policy Terms and conditions