[whatwg] Input type for phone numbers
Maciej Stachowiak
mjs at apple.com
Tue Mar 31 15:38:47 PDT 2009
On Mar 31, 2009, at 1:35 PM, Anne van Kesteren wrote:
> On Tue, 31 Mar 2009 22:19:35 +0200, Antti Koivisto <antti at apple.com>
> wrote:
>> Validation is indeed a complete red herring, this is about input
>> methods.
>
> In that case it might be better to re-introduce the inputmode=""
> attribute for this purpose. The specific type="" attribute values
> actually ensure (when implemented) that some normalized form of the
> data goes to the server. If that is not a goal here I'm not sure we
> should introduce a type="" attribute value for it.
I don't think it's right to think of type="" as only, or even
primarily, about validation to a specific format. <input type="text">,
<input type="password"> and <input type="search"> all allow the same
set of values, and differ only in the UI. <input type="button"> and
<input type="image"> have the same effect, but different presentation.
Checkboxes and radio buttons only indicate whether they are on or off,
but differ crucially in UI.
On the other hand, the server side can never count on client-side
validation, since it may be sent malformed requests by older or non-
browser clients. So the main value-add for many kinds of specialized
input fields is the user interface, not format validation. The idea
that type="" has anything at all to do with client-side validation is
a new idea in HTML5 and not something that applies to every kind of
control.
I think inputmode="" is not relevant here. Popping up a specialized
control that lets you pick a phone number from your address book is
not a specialized keyboard or input method, it's a different control.
So in conclusion, whenever a control for entering phone numbers is
added, it should be via type="", not inputmode="".
Regards,
Maciej
More information about the whatwg
mailing list