• 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

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

How to Generate PDF invoice to XML format using mPDF

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

PHP Form Not Inserting

Target Individual Form Instance/Counter Inside A PHP While Loop

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

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

Insert And Retrieve Data in MySQL with $.post Noob Question

Check if user online laravel

Live search query using JS and PHP for QA forum

if statement inside concatenation

How do I refresh a DIV content?

PHP drop down list using array's and foreach (else and for) code

Star and Half Star Rating in Laravel

Ajax GET request fails in laravel 8

About Contact Privacy policy Terms and conditions