[whatwg] Removing multiple attribute from <input type=file multiple> with selected files
Ojan Vafai
ojan at chromium.org
Mon Dec 14 11:54:35 PST 2009
On Mon, Dec 14, 2009 at 11:39 AM, Jonas Sicking <jonas at sicking.cc> wrote:
> On Mon, Dec 14, 2009 at 10:33 AM, Ojan Vafai <ojan at chromium.org> wrote:
> > On Sun, Dec 13, 2009 at 7:47 AM, Jonas Sicking <jonas at sicking.cc> wrote:
> >> On Sun, Dec 13, 2009 at 5:36 AM, TAMURA, Kent <tkent at chromium.org>
> 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
> >>
> >> I ran into the same question when developing this for firefox. I don't
> >> really care what happens either way since I don't see a use case for
> >> removing the multiple attribute.
> >>
> >> What I ended up doing was to do your first option above.
> >
> > This should be an invalid thing to do. Can we throw an exception in
> addition
> > to leaving the list of files untouched?
>
> I would prefer not to throw an exception. Making removeAttribute throw
> an exception seems wrong since the attribute *is* in fact removed, and
> making foo.multiple=false throw would mean that it would behave
> differently from all other "mapped" IDL attributes.
>
> 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.
>
> You're off course free to put a warning in a developer console or
> something like that though.
I buy that. A warning seems appropriate. I'm sure *someone* will do this
someday, but it's probably rare enough that it's not worth putting effort
into.
Ojan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091214/ae886178/attachment.htm>
More information about the whatwg
mailing list