• 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 set a domain name with php artisan serve

PHP - CURL using HTTPS [closed]

Explain how this array transposing and flattening function works

How to fix bootstrap multiselect search data using ajax

How do I pass the dynamic output of a php variable or php function to a CSS variable?

How do I do HTTP basic authentication using Guzzle?

How to get the ID of the link in another page in php

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Issue with laravel eloquent model property

Add custom text under order details on WooCommerce My account view order pages

Reload parent page after submit in iframe

How To Access A Column In M-M Relationship Table In Laravel

XSS attack still works despite htmlspecialchars() doing its work

woocommerce_wp_select options array from product attribute terms

Get all WooCommerce products within own plugin

About Contact Privacy policy Terms and conditions