[whatwg] What should the value attribute be for multi-file upload controls in WF2?
Michael A. Puls II
shadow2531 at gmail.com
Sun Jun 22 15:21:13 PDT 2008
On 6/22/08, Lachlan Hunt <lachlan.hunt at lachy.id.au> wrote:
> Michael A. Puls II wrote:
> > Anyway, the use case for .value is:
> > ...
> > <p>File to attach: <p>
> > <p><input type="file"
> > onchange="document.getElementsByTagName('p').innerHTML
> > this.value;"></p>
> > ...
> How is that a use case? Please explain why outputting the value of the
> control in an adjacent paragraph is useful at all and why authors would do
> it. The value is visible in the control itself, so that seems unnecessary.
The file is visible in the control itself, but:
If the control is not long enough, you might not see the filename
unless you scroll in the field or the script resizes based on a
multiple of the length of .value. Even then, the path might be
An author might provide the filenames in a more friendly and readable way.
As another example, imagine you have <input type="file"> and onchange,
it adds a filename to a SELECT element and resizes the element.
Then, the select has an onchange listener itself. When you select a
different file in the SELECT, you can make something happen.
For example, you can browse to .wav files and add them to a select
playlist. Then, you can select each of the filenames to have them play
with Audio() for example. Attached is a super basic example of that.
Instead of Audio(), you might load theora videos and play them with
the VideoLan plugin or load wmv files and play them with WMP.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg