W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2010

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

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 1 Oct 2010 17:11:31 -0700
Message-ID: <AANLkTi=hHPPr12PLrt65Yk4o8pDeZC0QAhUJDh_bmNbZ@mail.gmail.com>
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)(,

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
Received on Friday, 1 October 2010 17:11:31 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:01 UTC