title: Autocomplete only working for the first time
body: <pre><code>&lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src='js/jquery.autocomplete.js'&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" /&gt;
  </code></pre>
  
  <p>The autocomplete works for the first time when the page is refreshed and i enter upto 4 character if i backspace and enter other character from start it doesn't work , can someone help me why is this happening</p>
  
  <pre><code>$().ready(function() {
  
  
      $("#customername").autocomplete("ajax/customerlist.php", {
          width: 260,
          dataType: 'json',
          matchContains: false,
          selectFirst: false,
          minlength:4,
          parse: function(data) {
  
                  var array = new Array();
                  for(var i=0;i&lt;data.items.length;i++)
                  {       //alert(data.items[i].name);
                          array[array.length] = { data: data.items[i], value: data.items[i], result: data.items[i].name };
                  }
                  return array;
          },
          formatItem: function(row) {                     
                  var name = '';
                  if (row.first_name &amp;&amp; row.last_name)
                          name = '('+row.first_name+', '+row.last_name+')';
                  else if (row.first_name)
                          name = '('+row.first_name+')';
                  else if (row.last_name)
                          name = '('+row.last_name+')';
  
                  return row.name+' '+name;
          }
      });
  
      $('#customername').result(function (event, data, formatted) {
        $( "#cust" ).val( data.id );
        var add= data.add1+data.add2;
        $( "#address" ).val( add );
        $( "#email" ).val( data.email );
        $( "#phone" ).val( data.phone );
        $( "#mobile" ).val( data.mobile );
  
      });
  });
  </code></pre>
  
  <p>the php code is</p>
  
  <pre><code>$getuser=$db-&gt;execute("select * from `customer` where customer_name like '%".mysql_$_REQUEST['q']."%'  ");
  
  
  while($getuserlist = $db-&gt;fetchAll($getuser)) {
  
  $list['items'][]=array('name' =&gt; $getuserlist['customer_name'],'id'=&gt;$getuserlist['customer_id'],'add1'=&gt;$getuserlist['add1'],'add2'=&gt;$getuserlist['add2'],'city'=&gt;$getuserlist['city'],'state'=&gt;$getuserlist['state'],'pincode'=&gt;$getuserlist['pincode'],'email'=&gt;$getuserlist['email'],'phone'=&gt;$getuserlist['phone'],'mobile'=&gt;$getuserlist['mobile']);
  
  }
  
  echo json_encode($list);
  </code></pre>