W3C home > Mailing lists > Public > public-html@w3.org > April 2007

Re: INPUT-PIC form control

From: Thomas Broyer <t.broyer@ltgt.net>
Date: Thu, 26 Apr 2007 10:12:10 +0200
Message-ID: <a9699fd20704260112jf2c37a6t37c756158e74bffc@mail.gmail.com>
To: public-html@w3.org

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

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:43 UTC