[whatwg] Interaction between @multiple, @pattern and @list

Jonas Sicking jonas at sicking.cc
Fri Oct 1 17:11:31 PDT 2010


Hi all,

We recently implemented support for a range of HTML5 forms feature in
Firefox. Included in that was support for <input type=email> as well
as the @multiple, @list and @pattern attributes.

The spec already says that for <input type=email multiple list=foo>
that the list of suggestions should be treated as individual email
addresses, rather than the complete value. This of course makes a lot
of sense.

However, for <input type=email multiple pattern=".*@company.com"> the
pattern is applied to the value as a whole, rather than to the
individual addresses. This seems less useful. It can be worked around
using more complex patterns, such as pattern=".*@company.com(,
.*@company.com)*". This works but is pretty clumsy. It also gets worse
for situations like pattern=".*@(company.com|parner.com)(,
.*@(company.com|partner.com))*".

I suggest that when pattern and multiple are both applied on a
control, that the pattern is applied to each individual component of
the value, rather than the value as a whole.


I also realized that @list currently is pretty useless in similar
situations together with <input type=text>. Often times text inputs
are used to enter a list of tokens. One example is the keyword input
field in bugzilla. It helps you autocomplete from the list of
available keywords, but also lets you enter multiple keywords in the
same text field. As things stand now you can't use @list to accomplish
this as it operates on the whole value rather than each comma
separated token.

It would be possible to make this work by allowing @multiple to apply
to <input type=text>. The only effect would be that @list and @pattern
would operate on each comma separated token.

/ Jonas



More information about the whatwg mailing list