title: Get value from input type file
body: <p>I would like to change the input type text value when I use the input type file. I've tried the following code, but I still cant figure it out how to handle this problem.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="text" name="imagem" class="filename" value="&lt;?php echo htmlentities($row_dados['imagem'], ENT_COMPAT, 'utf-8'); ?&gt;" size="32" readonly /&gt;
  
  &lt;input type="file" name="id_imagem"&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$('input[type="file"]').on('change', function (event, files, label) {
  var file_name = this.value.replace(/\\/g, '/').replace(/.*\//, '')
  $('input[type="text"].filename').value(file_name);
  });
  </code></pre>