title: Autocomplete in CodeIgniter MySQL with JQuery
body: <p>I found a problem regarding autocomplete in codeigniter, i want to make if I fill siteid with <em>autocomplete</em>, in another form (sitename) will show data from database directly, but i failed, autocomplete form in siteid not shown, so another field can't worked too</p>
  
  <p><strong>Here my controller code :</strong></p>
  
  <pre><code>    public function get_allkota() {
      $kode = $this-&gt;input-&gt;post('kode',TRUE); 
      $query = $this-&gt;db-&gt;get("tbl_site");
  
      $kota       =  array();
      foreach ($query as $d) {
          $kota[]     = array(
              'label' =&gt; $d-&gt;siteid,
              'nama' =&gt; $d-&gt;siteid ,
              'sitename' =&gt; $d-&gt;sitename,
          );
      }
      echo json_encode($kota);   
  }
  </code></pre>
  
  <p><strong>Here my jquery code :</strong></p>
  
  <pre><code>    &lt;script src="&lt;?php echo base_url(); ?&gt;assets/js/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="&lt;?php echo base_url(); ?&gt;assets/js/jquery-ui.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script&gt;
   $(function () {
      $("#kode").autocomplete({  
          minLength:0,
          delay:0,
          source:'&lt;?php echo site_url('app_admin_kabupaten/get_allkota'); ?&gt;', 
          select:function(event, ui){
              $('#siteid').val(ui.item.siteid);
              $('#sitename').val(ui.item.sitename);
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Here my form code :</strong></p>
  
  <pre><code>&lt;p&gt;&lt;input type="text" id="kode" placeholder="Fill site ID" &gt; &lt;/p&gt;
  &lt;p&gt;Site ID : &lt;/br&gt;&lt;input type="text" id="siteid"&gt;&lt;/br&gt;
     Site Name : &lt;/br&gt;&lt;input type="text" id="sitename"&gt;&lt;/br&gt;
  </code></pre>
  
  <p>thanks</p>