title: Why is this jquery autocomplete script do not care about the matching?
body: <p>I'm trying to get this script work for hours. I'm done with a part of it, but the script is not taking care the matching.</p>
  
  <p>So when I start to type in something, it will show up all the data from the database, even if it not match. If my database have 3 record, I going to see all, nevermind what I'm writing in.</p>
  
  <p><strong>Here are my records:</strong></p>
  
  <pre><code>Idoya idoya@xxxx.com 123 Livingston Road xxxxxxx, XX YYYYY
  Gideon gideon@xxxx.com 123 Wild Rose St. xxxxxxx, XX YYYYY 
  Collin collin@xxx.com 123 Inverness Street xxxxxx, XX YYYYY
  </code></pre>
  
  <p><strong>And my script:</strong></p>
  
  <pre><code>$(document).ready(function(){
  
      $('#name').autocomplete({
          source: function(data, cb){
              $.ajax({
                  url: 'index.php/PersonData/get_people',
                  method: 'GET',
                  dataType: 'json',
                  data: {
                      name:data.term
                  },
                  success: function(res){
                      //cb(res);
  
                      var d = $.map(res, function(row){
                          return {
                              label: row.name + " " + row.mail,
                              value: row.name,
                              mail: row.mail,
                              address: row.address
                          }
                      });
  
                      cb(d);
                  }
              });
          },
          select: function(event, ui) {
              $(this).val(ui.item.value)
              $('#mail').val(ui.item.mail)
              $('#address').val(ui.item.address);
          }
      });
  
  
  });
  </code></pre>
  
  <p>I want it to work like when I start to write <em>"Ido"</em> it just should to show up that one record with <em>"Idoya Vinay"</em>.</p>