On 6/22/08, Lachlan Hunt <[EMAIL PROTECTED]> 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
Select a file in the playlist to play it
Add a .wav file to the playlist:
