[whatwg] Text areas with pattern attributes?
ian at hixie.ch
Tue Sep 29 20:43:09 PDT 2009
On Mon, 31 Aug 2009, Jonas Sicking wrote:
> On Mon, Aug 31, 2009 at 12:04 AM, Ian Hickson<ian at hixie.ch> wrote:
> > On Sun, 30 Aug 2009, Jonas Sicking wrote:
> >> Ok, addresses might not be the best example. I would imagine that
> >> most use cases for pattern for a single line, carries over if you
> >> want to have that single line wrap and be displayed as multiple
> >> lines. So if you can provide the list of use cases that was used to
> >> add pattern on single-line input and I'd be very surprised if not
> >> most of them carries over to multi-line.
> > The main use cases that were considered as far as I recall were credit
> > card numbers and other bank numbers (we originally considered type=cc
> > but that turned out to be more locale-specific than expected), social
> > security numbers and other formatted serial numbers, and username
> > fields that exclude certain characters.
> So add 'multiple' on all of those and you'll have a good reason you'd
> want them all to be able to wrap over multiple lines. I.e. ability to
> enter multiple bank numbers, multiple social security numbers or
> multiple usernames.
I could see an argument for <input type=text pattern=... multiple>. That's
probably best left for a future version though.
But I don't think that's the same as multiline input.
> >> The difference between <input type=text> and <textarea> is mostly a
> >> rendering one. One scrolls the text when it can't fit, the other
> >> wraps. Do you really think that creates enough of a difference that
> >> the feature set should be different?
> > The feature sets are different in many other ways. This is hardly an
> > exception. For example, <textarea> has no list="" support, cols=""
> > works differently than size="", the default value is set differently,
> > <textarea> doesn't support autocomplete, etc.
> All of these seem like a bad idea to keep separate for multiline inputs
> vs. single line inputs. Except for the default value which for historic
> reasons make sense to use separate mechanisms, and cols/size which are
> both mostly rendering differences.
It's not clear how list="" would work with <textarea>, and I'm not aware
of any UA that does <textarea> autocomplete.
I don't necessarily think all this is how I would design this if we were
starting from scratch, but we're not, and I don't think we should be
making them consistent at this point without good use cases.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg