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

[whatwg] <input type=tel> validation, and a small set of typos

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 20 Jul 2009 15:11:10 -0500
Message-ID: <dd0fbad0907201311p5869247eg33e7e6f792fe8918@mail.gmail.com>
On Mon, Jul 20, 2009 at 2:47 PM, Peter Kasting<pkasting at google.com> wrote:
> Two unrelated comments.
> First, it seems a bit odd to me that <input type=email> and <input type=url>
> are validated (for typeMismatch problems) but <input type=tel> isn't. ?I
> know it's prohibitively difficult to perfectly validate telephone number
> formats given the variety around the world, but it's also prohibitively
> difficult to validate email addresses per the relevant RFC, which is why
> HTML5 specs a much simpler algorithm that at least rejects obviously bad
> input.
>
> It seems like perhaps <input type=tel> could set typeMismatch if the input
> contained no numeric digits at all, or maybe if it contained characters
> outside 0-9, +, -, (, ), ' ', ...? ?Maybe the level of "validation" provided
> by these proposals is so low that it's not worth doing, though.

You got it.  While emails officially have a very complex format, in
practice they follow a fairly simple, restricted format that can be
usefully validated.

Telephone numbers, on the other hand, differ wildly across the globs,
and you can't just identify a restricted subset that 'most' fall into.
 Even if you could identify a sane subset of validation that you could
apply widely, it would be weak enough to be worth basically nil in
terms of actually ensuring that you've received a valid telephone
number.

~TJ
Received on Monday, 20 July 2009 13:11:10 UTC

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