W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2009

[whatwg] Text areas with pattern attributes?

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 19 Aug 2009 11:38:53 -0700
Message-ID: <63df84f0908191138h32fc2a67o31a2894fe73b609@mail.gmail.com>
On Wed, Aug 19, 2009 at 8:32 AM, Geoffrey Sneddon<gsneddon at opera.com> wrote:
> Alex Vincent wrote:
>> I'm drifting into writing code for the pattern attribute on text
>> fields again, and I wondered: ?if text inputs can have pattern
>> attribute for regular expression matching, why not text area elements?
> What's the use-case for it? Textareas are almost always for such large
> amounts of input that they are almost always free-form text. Why allow the
> pattern attribute?

A similar argument was made against putting the placeholder attribute
on <textarea>, until someone found a page where it was used.

I think in general it makes very little sense to say that <textarea>s
are different from <input type=text>. Technically the only difference
is that one is multiline and the other is not. So it seems like
anything that makes sense in <input type=text> makes sense in

So for the pattern attribute, a use case would be on a site that
accepts US addresses (for example a store that only ships within the
US), the site could use a textarea together with a pattern that
matches US addresses.

/ Jonas
Received on Wednesday, 19 August 2009 11:38:53 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:15 UTC