how to write a function in input type =file
in php.Html code without echo statemen
t is working well as copying the path to textbox.
<form name="profile" method="post" enctype="multipart/form-data">
<?php
echo '<p style="margin-left:1cm"><input type="text" id="file2" size=18 maxlength=500><input type="file" name="bfile2" onchange="CopyMe(this, 'file2');" /></p>';
?>
</form>
<script>
function CopyMe(oFileInput, sTargetID) {
document.getElementById(sTargetID).value = oFileInput.value;
}