Search
 
SCRIPT & CODE EXAMPLE
 

PHP

bootstrap autocomplete example ajax php mysql

<html lang="en">
<head>
  <title>Jquery select2 ajax autocomplete example code with demo</title>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
  <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
</head>
<body>


<div style="width:520px;margin:0px auto;margin-top:30px;height:500px;">
  <h2>Select Box with Search Option Jquery Select2.js</h2>
  <select class="itemName form-control" style="width:500px" name="itemName"></select>
</div>


<script type="text/javascript">
      $('.itemName').select2({
        placeholder: 'Select an item',
        ajax: {
          url: '/ajaxpro.php',
          dataType: 'json',
          delay: 250,
          processResults: function (data) {
            return {
              results: data
            };
          },
          cache: true
        }
      });
</script>


</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Php :: php send 204 
Php :: laravel asset resolving to http not https 
Php :: <= in php 
Php :: laravel gigapay delete invoice 
Php :: Add laravel sail build as alias 
Php :: refresh_ttl 
Php :: General errorstring fetchAll() php 
Php :: how to export and import database in phpmyadmin 
Php :: laravel return new tab 
Php :: onesignal update device api 
Php :: verify that a valid login cookie was sent in order to do special things for that logged-in 
Php :: Best version control tools for php 
Php :: symfony retun json 
Php :: PHP code to redirect a user from a page to an alternate destination 
Php :: laravel many to many 
Php :: wp+get author box in dashboard 
Php :: php connect 
Php :: edit paginator object 
Php :: trim string in php codeigniter 
Php :: Array and string offset access syntax with curly braces is no longer supported in /home/southsah/public_html/wp-content/install.php on line 259 
Php :: wordpress curl wp remote post timeout error 
Php :: type of var php 
Php :: Call to a member function delete() on null laravel 8 
Php :: user input in oop php 
Php :: symfony user online 
Php :: Set post views count using post meta 
Php :: Calculate the remaining days on view Laravel, negative days if date has passed 
Php :: easyadminbundle 4 $this-get(EntityRepository::class) error 
Php :: Update database table row if a qualifying token is provided 
Php :: rerender block in twig 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =