Re: INPUT-PIC form control

2007/4/26, Dmitry Turin:
>
> I think, that preview of picture must be in document, not in explorer
> for file system.

<input type="file" accept="image/*"
    onchange="document.getElementById('preview').src='file://'+this.value">
<img id="preview" src="blank.png" alt="">

Maybe this could be made possible without scripting with a construct
such as the following, but I don't expect more from HTML.

    <input type="file" id="image-upload" accept="image/*">
    <img src="#image-upload" alt="">

i.e. if src="" is a same-document reference [1], it must point to an
<input type="file">; in this case, whenever the input's value change,
the src="" should be updated to the new value.
And of course, same for <object data="">, <audio src="">, <video
src=""> and other similar elements I might have forgotten.

Another proposal:

    <input type="file" id="image-upload" accept="image/*">
    <img src="blank.png" alt="" preview="image-upload">

[1] http://www.apps.ietf.org/rfc/rfc3986.html#sec-4.4

-- 
Thomas Broyer

Received on Thursday, 26 April 2007 19:45:29 UTC