Is it possible to fill the text box with the file name that is selected in file upload?
<script type="text/javascript">
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;
}
here is my html code:
<form id="upload" name="upload" action="<?php echo base_url(); ?>index.php/welcome/upload_gen048" method="POST" class="form-horizontal" enctype="multipart/form-data" onsubmit="return verify_upload()" >
<div class="col-lg-4"></div>
<b style=" padding:.3em; font-size:15px;color:white"> </b><input style="border:1px solid" type="text" onfocus="true" name="fiil" id="fiil" value=""size="30" />
<input type="file" name="uploadData" id="uploadData" style=""/>