loading an image onchange "input type/file" field

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Pastrovick

    #1

    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
  • Ivo

    #2
    Re: loading an image onchange "input type/file" field


    "John Pastrovick" asks[color=blue]
    > 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.[/color]

    Not all browsers cooperate. Try
    <URL: http://www.4umi.com/web/javascript/imagewizard.htm >
    [color=blue]
    > 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.[/color]

    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


    Comment

    Working...