• 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

PHP array sort and remove duplicates by two field values

How to submit a form when page loads using JavaScript?

PHP array_filter with arguments

yii2 and mssql insert varbinary into model

How to insert Google Adsense Code in PHP script?

Laravel views are showing from cache on one server but works fine on other server

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

Send same name multiple checkbox values via ajax

how to validate form data in codeigniter 4

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

How to redirect to another page after n seconds in wordpress without using javascript?

How to add a sidebar to Woocommerce Shop Page?

PHP Include for HTML?

PHPS source file - 403 Forbidden You don't have permission to access this resource

Best way to scrolldown onpageload

About Contact Privacy policy Terms and conditions