title: Is there a way I can auto fill an input form based on a selectbox drop down?
body: <p>I'm trying to auto fill an input form based on the selection of a selectbox.
  the auto fill text comes from my database</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
  &lt;label for="kode_part" class="control-label"&gt;Kode Part &lt;span&gt;&lt;small class="text-danger"&gt;*This field is required&lt;/small&gt;&lt;/span&gt;&lt;/label&gt;
  &lt;select class="form-control kode_part" name="kode_part" id="kode_part" required&gt;
  &lt;?php if(count($tabel_part)){ ?&gt;
  &lt;option&gt;&lt;/option&gt;
  &lt;?php foreach ($tabel_part as $list){ ?&gt;
  &lt;option data-info="&lt;?php echo $list['kode_part'] ?&gt;"&gt;
  &lt;?php echo $list['kode_part']; ?&gt;
  &lt;/option&gt;
  &lt;?php } ?&gt;
  &lt;?php } ?&gt;
  &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>text auto fill based on selection:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
  &lt;label for="nama_part" class="control-label"&gt;Nama Part*&lt;/label&gt;
  &lt;input class="form-control form-control-sm" id="nama_part" name="nama_part" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>script:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
  $('#kode_part').change(function(){
  $('#nama_part').val( $(this).find('list:selected').data('nama_part') ); 
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>i've try that but nothing happens in my view.
  Any help you can give I appreciate it</p>