The code displays the picture that is selected before the upload button is
pressed – so you are sure which picture you have selected.
Very useful!
the problem is that works nicely in my Mozilla browser
but not in IE.
How do I get it to work in IE ?? what is the code that IE doesnt like ?
Thanks for youir help. ?
<script language=”JavaScript” type=”text/javascript”>
<!–
function changeSrc1(who){
img=who.replace(who.substring(0,1),’file:///’+who.substring(0,1));//add ‘file:///’ before the drive letter
img=img.replace(/
document.getElementById(‘preView1’).src=img;
} // end of function
–>
</script>
</head>
<body>
<div style=’position:absolute; left:20px; top:60px’>
<form enctype =”multipart/form-data” action=”upload.php” method=”POST”>
<input type=”hidden” name =”MAX FILE SIZE” value=”500000″>
<table width=”400px” border=”0″ cellspacing=”0″ cellpadding=”1″>
<tr>
<td>Picture file path: </td>
<td>
<input type=”file” id=”x_pix1″ size=”50″ onchange=”changeSrc1(this.value)”
name=”pix1″ value = “<?php echo $x_pix1 ?>”>
</td></tr>
<tr><td>
<input type=”submit” name=”upload” value=”Upload Picture”>
</td></tr>
</table>
</form>
</div>
<div id=’PreView1′ style=’position:absolute; left:30px; top:200px’ >
<img id=”preView1″ width=”120″ height=”120″ />
<br>
– – – Picture 1 – – –
</div>