From a file browser I hae browsed a file from the local machine.Now I want to show the image below the file browser before submitting the form
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sanjay_Sen
Posted On:   Thursday, March 10, 2005 01:31 AM

From a file browser I hae browsed a file from the local machine.Now I want to show the image below the file browser before submitting the form

Re: From a file browser I hae browsed a file from the local machine.Now I want to show the image below the file browser before submitting the form

Posted By:   Anonymous  
Posted On:   Thursday, March 10, 2005 02:35 AM

This won't work in Firefox, or other newer Mozilla clients because of security restrictions, but it will work in all IE versions... What you can do is the following (in your )



This script just checks 5 times a second whether the value in the input field has changed, if so it attempt to load it.


Note that you'll have to use the correct ID's. The INPUT field representing the file should have the same ID as the first getElementById, and the previewImg should be the ID of the image element you want to put the preview in.. for example: .



because of security restrictions this will not work in Gecko clients (firefox, mozilla), and might not be supported anymore in new IE versions. There is no other easy way to accompish this.

About | Sitemap | Contact