• 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

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

Assets not referencing to public folder (Laravel)

Image upload not working through ajax Laravel

How can I create a Download Page with post php method?

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

Changing font color in javascript

How to create custom authentication in laravel 8?

Need to display only array value in JSON output

Laravel - Implicit route model binding with soft deleted data

Doctrine 2 mapping referencing unique key

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

Insert a DIV after the 6th product only once in WooCommerce category archives

WooCommerce: Add/display Product or Variation custom field everywhere

Check if my GET request has Header: Token

Laravel Get Days In Month From Month Number?

About Contact Privacy policy Terms and conditions