Link to home
Start Free TrialLog in
Avatar of MK15
MK15

asked on

using input file to display thumbnail

Hi,
is it possible to display a thumbnail when the user selects a image?  

Thanks
Avatar of EMB01
EMB01
Flag of United States of America image

Certainly.  How would you like to display the thumbnail?  What does your app look like?  Send some code and tell me what you want and I'll help you.
I have two code examples, one in JavaScript and another in JQuery.  The javaScript one is a bit more complicated than it needs to be for a simple example but it works.  The JQuery one is simpler.

JavaScript -- http://hugh.tekcities.com/hugh/program/web/jsThumb.php

JQuery -- http://hugh.tekcities.com/hugh/program/web/jqThumb.php
What I'm asking is:

Are you trying to have a single image like this:

[main image]

And, then have a bunch of thumbnails like this:

[thumnbail][thumnbail][thumnbail]

And, when a user clicks a thumbnail then the main image becomes an enlarged version of the thumbnail they clicked?

Basically, just tell me specifically what you're trying to do.
Avatar of MK15
MK15

ASKER

ok sorry for the lack of information.

what i am trying todo is have a button(<input type='file' name ='select_image'/>), where the user can select an image to upload.  The selected image is then displayed in a thumbnail image holder '<img src="selected_image" alt="image" />'.  I want todo this before actually submitting the form.

Hope this is clearer.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of EMB01
EMB01
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MK15

ASKER

o ok, thats interesting, ill look into that.

thank you both for your help
To help you out, check out http://www.uploadify.com/.  It's a great ajax uploader.