/    Sign up×
Community /Pin to ProfileBookmark

Displaying the image.

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(//g,’/’);//replace all backslashes with forward slashes
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>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Jun 12.2005 — I do not think IE needs the file part. I am too lazy to test...
Copy linkTweet thisAlerts:
@DaveinLondonauthorJun 13.2005 — Sorry but I don't know what you mean by that.

Can anyone help on with this please - I am pretty stuck! ?
Copy linkTweet thisAlerts:
@DaveinLondonauthorJun 13.2005 — Any help on this will be really appreciated - thanks ?
×

Success!

Help @DaveinLondon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...