Populate text field from file select
<p>Is it possible to fill the text box with the file name that is selected in file upload? </p>

<pre><code>&lt;script type="text/javascript"&gt;
var textbox = document.getElementById('fiil');
var fileselect = document.getElementById('uploadData');

fileselect.onchange = function(){
      textbox.value = textbox.value  + this.value; //to appened
     //textbox.innerHTML = this.value; 
}
</code></pre>

<p></p>

<p>here is my html code:</p>

<pre><code>&lt;form  id="upload" name="upload" action="&lt;?php echo base_url(); ?&gt;index.php/welcome/upload_gen048" method="POST" class="form-horizontal" enctype="multipart/form-data" onsubmit="return verify_upload()" &gt;
&lt;div class="col-lg-4"&gt;&lt;/div&gt;
&lt;b style=" padding:.3em; font-size:15px;color:white"&gt; &lt;/b&gt;&lt;input style="border:1px solid" type="text" onfocus="true"  name="fiil" id="fiil" value=""size="30" /&gt;
&lt;input type="file" name="uploadData" id="uploadData" style=""/&gt;
</code></pre>