• 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 insert data into select2 search input after scan using qrcode

javascriptphpcodeigniterjquery-select2


PHP Snippet 1:

$('#add_order').select2();

PHP Snippet 2:

$(function(){
  //Your script
  console.log($('#add_order').lenght);//should display 1!
  $('#add_order').select2();
   :
   :
});

PHP Snippet 3:

$('#add_order').val("yourvalue").trigger("change");

Related Snippets

Xdebug in Laravel is not working with VSCode

how to use extended ASCII instead of unicode in PHP

PHP 8.1: strftime() is deprecated

CodeIgniter extend CI_URI undefined method

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

How to load Codeigniter 4 lang file into an array variable

Woocommerce Checkout - Add conditional field required if one field is filled

Upload a file Using PHP and JavaScript

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

Laravel multi auth - Authentication user provider [] is not defined

How do I remove this delivery notification from here?

Limit WooCommerce products in cart only from one custom taxonomy

How do I truncate a decimal in PHP?

Get all WooCommerce products within own plugin

I want a way to give path to my files which are outside of public folder in laravel

About Contact Privacy policy Terms and conditions