467,891 Members | 1,700 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,891 developers. It's quick & easy.

loading an image onchange "input type/file" field

Is there a way to load an image locally (in the client) when a
selection of a file is made using input type=file.

The purpose is to allow selection of a file and put the image in the
browser without loading the reloading the page.
I thought about

1. putting a function call in the onchange event of the html input
field (the type of form field that allows selection of a local file
path)

2 In the javascript function, retrieve the value of the field and

3.Load the image by changing some image src property.

Basically i want to change the value of the image name and load it
w/out reloading the image based on a selection of an input/file-type
selection.
Thanks
Jul 23 '05 #1
  • viewed: 8734
Share:
1 Reply
Ivo

"John Pastrovick" asks
Is there a way to load an image locally (in the client) when a
selection of a file is made using input type=file.

The purpose is to allow selection of a file and put the image in the
browser without loading the reloading the page.
Not all browsers cooperate. Try
<URL: http://www.4umi.com/web/javascript/imagewizard.htm >
Basically i want to change the value of the image name and load it
w/out reloading the image based on a selection of an input/file-type
selection.


Not sure I follow. What is certain is you cannot change the value of an
input/type=file scriptwise. You can clear the box only by removing the
element from the DOM and re-adding it.
HTH
Ivo
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ben | last post: by
2 posts views Thread by Mr.Clean | last post: by
2 posts views Thread by IkBenHet | last post: by
5 posts views Thread by Mark Woodward | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.