bm014d0190
|
| Posted: 07/25/2005, 8:26 AM |
|
I want to upload a image to a website "images folder"
Once the user has entered an image - is it possible to display the
image when editing
|
|
|
 |
eiden
Posts: 34
|
| Posted: 07/31/2005, 10:36 AM |
|
Were you thinking something like this ?:
<script>
function ShowImage(img){
document.getElementById('Preview').src = img;
}
</script>
<input type="file" onchange="ShowImage(this.value)">
<br><br>
<img src="" id="Preview" height="180px">
|
 |
 |
donb
Posts: 52
|
| Posted: 07/31/2005, 4:39 PM |
|
If by 'edit' you mean showing the upload form in edit mode (where you might be uploading a new image or editing other info in the database record), then just put an Image control onj the form and set its data source to the database column that holds the file/path value.
It's nice to add BeforeShow event code to the Image, so that you set it to not be visible when there is no image file (such as when Inserting the record initially). That keeps you from seeing the evil 'red X' because no image exists yet.
This will let you see the image currently in the upload folder, assuming of course that the image is accessible via an appropriate URL on your webserver.
Going one step further, you could us an ImageLink instead of the Image control, set the Imagelink image the same way as with the Image control, but set it's height or width to make it appear smaller (or set it to display a small thumbnail if you happen to have one stored. Then you can have the Image Link open the image in a separate page at full size.
_________________
http://www.gotodon.com/ccbth |
 |
 |
Oper
Posts: 1195
|
| Posted: 07/31/2005, 9:02 PM |
|
Like Donb said just add an Image Display COntrol (with the Resouce fields pointing to the Image Field.
If the Upload image is on anoterh folder use something like:
on before show event:
Form.FieldNImage.value = "/Folder/Img/" & Form.FieldNImage.value
http://www.GlobalDevelop.com
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
|