• 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

Return multiple values from a function using mysqli_fetch_assoc [closed]

PHP each() function replacement

get folder directory from input type file - PHP

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

How to get variable from JavaScript to PHP [duplicate]

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

How to execute sql code based on fetch array

How to make a array inside array?

Dynamic table in HTML using MySQL and php

Backend cannot be reached after Typo3 login screen

Hi, I am making a contact form thingy, and my php isn't working any reason why?

PHP 8.1: strftime() is deprecated

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

Symfony autowiring issues since docker update

Input and output values for php into the browser?

About Contact Privacy policy Terms and conditions