<script>
function preview(thisImg,thisObj){
        thisImg.src="file:\/\/"+thisObj.value;
}
</script>

<img src="clear.gif" name="myimg">

<form name="myform" action="myaction.cfm" method="post"
enctype="multipart/form-data">
<input type="file" name="upfile">
<input type="button" name="func" value="Preview"
onclick="preview(myimg,upfile);">
</form>


This works in IE at least, didn't test in anything else.

Joshua Miller
Head Programmer / IT Manager
Garrison Enterprises Inc.
www.garrisonenterprises.net
[EMAIL PROTECTED]
(704) 569-9044 ext. 254
 
************************************************************************
*************
Any views expressed in this message are those of the individual sender,
except where the sender states them to be the views of 
Garrison Enterprises Inc.
 
This e-mail is intended only for the individual or entity to which it is
addressed and contains information that is private and confidential. If
you are not the intended recipient you are hereby notified that any
dissemination, distribution or copying is strictly prohibited. If you 
have received this e-mail in error please delete it immediately and
advise us by return e-mail to [EMAIL PROTECTED]
************************************************************************
*************


-----Original Message-----
From: Joe Zanter [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 06, 2003 2:26 PM
To: CF-Talk
Subject: image upload via cffile: preview prior to submit?


Hi List!

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

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

Ideas? Ridicule? 8-P

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

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

Visualize Whirled Peas!


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


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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