[whatwg] Changing punctuation value of input element in telephone state

Mounir Lamouri mounir.lamouri at gmail.com
Tue Apr 6 16:03:20 PDT 2010


On 04/07/2010 12:55 AM, Ian Hickson wrote:
> On Wed, 7 Apr 2010, Mounir Lamouri wrote:
>> On 04/07/2010 12:37 AM, Ian Hickson wrote:
>>> On Tue, 6 Apr 2010, Mounir Lamouri wrote:
>>>>
>>>> For input element in telephone state [1] specs say "User agents may 
>>>> change the punctuation of values that the user enters." I do not really 
>>>> get it. What is the idea ?
>>>
>>> For example, if I enter "1 650 253-0000", the user agent is allowed to 
>>> change that to "+1 (650) 253 0000" or "16502530000" or "+1 (650) 
>>> 253-0000". This is because such reformatting is common practice in 
>>> telephone number entry fields.
>>
>> I understand this is common but as the UA is "allowed to" behave a
>> certain way, it is going to be really hard for the webpages to check the
>> telephone numbers validity. With the example you gave, for one entry,
>> three different values have been generated.
>> In my opinion, this is the contrary of the spirit of no type-mismatch
>> constraint validation.
> 
> Well the alternative is to not have the user agent change the value at 
> all, in which case you still have to do server-side canonicalisation, so I 
> don't think it really makes any difference.
> 

If the UA is not changing the value, we are sure at least webpage
authors can easily specify how they want the telephone number to be
formatted and check it with pattern attribute (or use setCustomValidity()).
I've opened bug 9439 about this issue.

--
Mounir



More information about the whatwg mailing list