Just did this yesterday.

<script type="text/javascript">
function showImage(img) {
        var imgObj = document.images['header'];
        imgObj.src = 'file:///' + img;
}
</script>

<input type="File" name="header_image" id="header_image" size="45" 
onchange="showImage(this.value)">
<img src="bg_head.gif" name="header" id="header">

However this doesn't work completetly in NS4 or at all in Mozilla
because I was being lazy and the site was IE only anyway. NS4 because
it doesn't support changing an image _size_ via JS (src it will
change), you would have to use doc.write to write the img tag to a
span/div/ilayer/layer in NS4. It should work in Mozilla, but it wasn't
for me yesterday...because Mozilla has more bugs than MX even lol.
Specifically though, the onchange event wasn't firing in Moz.


-- 
 jon
 mailto:[EMAIL PROTECTED]

Thursday, March 6, 2003, 2:25:40 PM, you wrote:
JZ> Hi List!

JZ> I have templates which allow a user to upload an image. I would like to be
JZ> able to let the user preview the image before they commit the form: 
JZ> They browse to locate the image file, and after they've said ok to a file,
JZ> the file path info is populated in the "upfile" field in the form (below). I
JZ> was thinking there should be a JS way to display that image right after the
JZ> "upfile" field is populated and before the form is committed.

JZ> I didn't *want* to use another page to do it (select image, submit form, use
JZ> next page to add additional descriptors) but being a js novice...

JZ> Ideas? Ridicule? 8-P

JZ> The form:
JZ> (using cf5)
JZ> <cfform action="image_process.cfm" method="post"
JZ> enctype="multipart/form-data">
JZ> <strong><p align="center">click browse to enter the filename!<br> 
JZ> <cfoutput>
JZ> <input name="upfile" type="File" size="50" required="yes">
JZ> <input type="Hidden" name="mountnumber" value=#URL.mountnumber#>
JZ> <br><br>
JZ> caption: <input name="caption" type="text" size="50" required="no"
JZ> VALUE="enter caption here" onfocus="javascript:this.value='';">
JZ> --snip--

JZ> joe
JZ> --
JZ> Joe Zanter,  Materials Lab, Woodward Aircraft Engine Systems 
JZ> 5001 North 2nd Street, Rockford  IL  61125
JZ> ph 815-639-6312, fx 815-639-5104
JZ> mailto:[EMAIL PROTECTED]

JZ> Visualize Whirled Peas!


JZ> ***
JZ> The information in this e-mail is confidential and intended solely for the
JZ> individual or entity to whom it is addressed. If you have received this
JZ> e-mail in error please notify the sender by return e-mail, delete this
JZ> e-mail, and refrain from any disclosure or action based on the information.
JZ> ****

JZ> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to