[whatwg] Input type for phone numbers
mjs at apple.com
Tue Mar 31 10:13:11 PDT 2009
On Mar 31, 2009, at 10:02 AM, James Graham wrote:
> Markus Ernst wrote:
>> So, while e-mail addresses have a strictly defined format, this
>> does not apply to phone numbers. Internationalisation would be
>> necessary to validate them, and still it would be a hard task, as
>> complete sets of valid formats might not be available for every
> FWIW I would imagine that the most useful aspect of <input
> type="tel"> or whatever would not be validation (because validation
> is hard) but would be better integration on mobile devices e.g.
> making the default action of the keypad be number keys, making phone
> numbers from the contacts list available, etc. (these were both
> pointed out already). Therefore whilst I totally recommend this
> feature be postponed for HTML6, I think it makes a lot of sense and
> that problems with validation are a red herring.
Not just on mobile devices. Desktop browsers can also offer
integration with the system Address Book, and to some extent do this
already based on heuristics that guess which input fields are for
phone numbers. I believe every major browser has heuristics like this.
Having an unambiguous way to indicate that a field expects a phone
number would allow for better integration. It would eliminate false
negatives, since phone number fields may be missed if they don't use a
name="" that enables the browser to guess. And by eliminating false
positives, it would make it practical to make more extensive changes
to the field, such as actually replacing it with a pop-up to choose
phone numbers for example.
While I sympathize with the desire to see current HTML5 form controls
implemented first, frankly, we would be more interested in
implementing <input type="tel"> than the six different date/time
controls currently in HTML5. It seems to me that entering a phone
number is much more common than entering any kind of date at all, and
certainly more common than entering a month or a week.
More information about the whatwg