maxwells / bootstrap-tags

Bootstrap-themed jquery tag interface
MIT License
548 stars 133 forks source link

get Suggestion from Database mysql #75

Open kunz398 opened 7 years ago

kunz398 commented 7 years ago

i have this code i want it to be in the suggestion place but i cant even select input box

<div id="my-tag-list" class="tag-list">
    </div>

$(function() {      
      $('#ID FOR THE INPUT BOX').bind('keyup', function(){
       var searchTerm = jQuery.trim($(this).val());
       if(searchTerm == ''){
      $('#search-container ul').html('');
       }else{
      //send the data to the database
      $.ajax({
       url: 'searchtags.php',
       type: 'GET',
       data: {search:searchTerm},
       beforeSend: function(){
        $('#search-container ul').html('<li>Loading...</li>');
       },
       success: function(data){
        $('#search-container ul').html(data);
       }
      });
       }
      });

  $('#my-tag-list').tags({
            tagData:[],
            suggestions:["data"], //the suggestion would go here
        maxNumTags:[4]
        });