Hello everybody,

I wonder, is it possible to load an image (which the user is choosing
by a form) directly with javascript without submitting the form?

For instance, I could have:

<form>
          <strong>Page Background: </strong>
          <input id="bg_image_path" type="file" name="bg_image"  />
          <em>Upload the image that you want to use as a background.</
em>

          <a id="preview_btn" href="javascript:void(0);" >PREVIEW</a>

          <input type="submit" value="SUBMIT" class="form_button">
</form>

If they press SUBMIT the form goes to the server but, if before, they
want to see a preview they can have it clicking the PREVIEW link... of
course. ;-)

I'm working on this preview just using javascript, is there a way to
get the picture and not the just path???

Because if I write:

$("#bg_image_path").val();

I'll get just the path.

Thanks in advance.

Andrea

Reply via email to