erum mirza

erum mirza

  • NA
  • 428
  • 0

autocomplete with 2d array

Apr 6 2019 11:33 PM
hi to every one
 I am   working with jquery and mvc 5 and here is below code ,,but auto complete is not working .. also full file is attached
  1. <div class="col-lg-6" style="padding-top: 4rem;padding-left: 10px;">  
  2.   
  3.                       <div class="ui-widget">  
  4.                           <label for="customer"> </label><input id="customer" />  
  5.                       </div>  
  6.                   </div> 
 
  1. <link href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" rel="Stylesheet" />  
  2.   <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>  
  3.   
  4.   <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>  
  5.   <link id="myCss" href="~/Content/StyleSheet1.css" rel="stylesheet" />  
  6.   <link href="~/Content/bootstrap.min.css" rel="stylesheet" />  
  7.   <link href="~/Content/bootstrap.css" rel="stylesheet" /> 
  1. $("#customer").autocomplete({  
  2.               source: function (request, response) {  
  3.                   //response($.map(list, function (item) {  
  4.                   //    if (ui.item.label.indexOf($("#customer").val()) == 0) {  
  5.                   //        return {  
  6.                   //        //    label: ui.item.label,  
  7.                   //          //  value: ui.item.value  
  8.                   //        }  
  9.                   //    }  
  10.              // })  
  11.          // )  
  12.               },  
  13.               select: function (event, ui) {  
  14.                   selectedValue = ui.item.value;  
  15.                   selectedText = ui.item.label;  
  16.               },  
  17.               minLength: 1  
  18.           }); 

 

Attachment: CreateTopic.rar

Answers (1)