W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2008

[whatwg] What should the value attribute be for multi-file upload controls in WF2?

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Sun, 22 Jun 2008 18:21:13 -0400
Message-ID: <6b9c91b20806221521s3d428038vca6c5b9ac78bf368@mail.gmail.com>
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')[0].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
considered noise.

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.

-- 
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080622/fb258fe1/attachment.html>
Received on Sunday, 22 June 2008 15:21:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:03 UTC