[whatwg] Changing punctuation value of input element in telephone state
Ashley Sheridan
ash at ashleysheridan.co.uk
Tue Apr 6 16:31:39 PDT 2010
On Wed, 2010-04-07 at 01:28 +0200, Eduard Pascual wrote:
> On Wed, Apr 7, 2010 at 1:10 AM, Ian Hickson <ian at hixie.ch> wrote:
> > If there was a true standard, then the spec would refer to that, but as
> > you say, it's very varied in practice.
>
> There is quite a standard, even if an implicit one: (almost) no punctuation.
> Have you ever dialed a "(" or a "-" when phoning someone? In essence,
> phone numbers are sequences of digits, and punctuation is only used as
> a convenience to enhance readability.
> There are two exceptions to this: "+" and letters are used as
> replacement for numbers (the plus sign for the international call
> code, the letters for specific digits to enable creating "branded"
> numbers easier to memorize).
>
> Maybe I'm being too hasty with this idea but, since machines don't
> really need the same readability aids as humans do, I'd suggest that
> the UA simply removes everything other than "+" and alphanumeric
> characters (and obviously adds nothing) when sending the field. I
> don't care too much about what they do upon rendering the introduced
> value (and I think it's probably fine if the browser adds some
> formatting based on its own or the system's regional settings). The
> server is only left with replacing letters and "+"; plus any
> application-specific usage of the value itself (which, by then, will
> be a string of digits; assumedly representing the sequence of digits
> to dial).
>
> Other than that, the only safe alternative would be to leave the
> values untouched, so the page can say what it wants, the user honor
> it, and the server get it as expected; or gracefully degrade to an
> error message that actually points to the user error (rather than an
> error introduced by an UA trying to be out-smart the user).
>
> For sites that are ready to sanitize values from a specific locale;
> but which are accessed through an UA with different settings (ie: on a
> public place while abroad), the UA adding locale-specific stuff to a
> phone value is very likely to render whole forms unusables.
>
> Regards,
> Eduard Pascual
Phone numbers can also validly include pause characters too. I remember
back in the day saving such a number to quickly dial into my voicemail,
rather than having to dial in, wait for the automated voice, press a
digit, wait for some more robot speaking, press another number, etc.
Also, not entirely sure, but would asterisks (*) and hashes (#) be
included too? I was just going on what digits exist on a standard phone
keypad.
Thanks,
Ash
http://www.ashleysheridan.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100407/2548803b/attachment.htm>
More information about the whatwg
mailing list