Reply LinkBack Thread Tools Search this Thread
Old 29-08-2006, 19:39   #1 (permalink)
emarch
Registered User
 
Join Date: Aug 2006
Posts: 1
Image preview code -- what's wrong?

Let me start out by saying hi to everyone, this is my first post here.

I am currently developing some tools for a web page I'm working on, and the code works fine for IE but not so for Firefox.

Basically I want to allow the user to upload a picture to the server and show a preview of the image before the file is uploaded. The picture is to be updated when the user chooses the file.

Here is the code:

<script type="text/JavaScript">
<!--

function updatePreview(id)
{
var e = document.getElementById(id);

document.getElementById("img_preview").src = e.value;
}

//-->
</script>

This is inside the <form> </form> Code
<input type="file" name="file_src" id="fl_src" onChange="updatePreview('fl_src');" />

This is the image place holder
<img src="preview.jpg" id="img_preview" />

Thanks in advance to anyone that can help me out with this.
  Reply With Quote
Old 30-08-2006, 07:05   #2 (permalink)
paulanthony
mingin dawg baitch
 
paulanthony's Avatar
 
Join Date: Apr 2004
Location: Belfast
Posts: 1,035
Send a message via MSN to paulanthony
Dont think firefox will support this.

http://javascript.internet.com/forms...d-preview.html
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8