[whatwg] Removing multiple attribute from <input type=file multiple> with selected files

Ian Hickson ian at hixie.ch
Fri Feb 12 00:16:00 PST 2010


On Sun, 13 Dec 2009, TAMURA, Kent wrote:
>
> What should happen to selected files in a case that a user selects 
> multiple files for <input type=file multiple> and then a script code 
> removes the multiple attribute from the input element?
> 
> - nothing, no change to the selected files and they will be submitted,
> - cleared, or
> - a single file remains

Either it's cleared or all but one file is removed, the spec doesn't say 
anything beyond saying that if the attribute is missing, no more than one 
file may be selected.

The UA is allowed to change the selected files more or less arbitrarily 
("on behalf of the user"), so it's not really clear what we should say 
beyond that. However, I'm happy to specify this in more detail if it turns 
out that this is necessary for interop.


On Mon, 14 Dec 2009, Ojan Vafai wrote:
> 
> This should be an invalid thing to do. Can we throw an exception in 
> addition to leaving the list of files untouched?

Throwing an exception for DOM changes that are otherwise allowed would be 
very unusual.


On Mon, 14 Dec 2009, Jonas Sicking wrote:
> 
> I'd really prefer to keep things simple here as I doubt that this is 
> something that anyone will ever do. Much less depend on a particular 
> behavior.

Famous last words in this world!

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list