W3C home > Mailing lists > Public > public-html@w3.org > June 2009

Re: <input type="number"> restricting user input to only valid characters

From: Michael(tm) Smith <sideshowbarker@gmail.com>
Date: Sat, 20 Jun 2009 14:15:25 +0900
Message-ID: <386945ea0906192215p5eafddbfk4c5ef386915cecd3@mail.gmail.com>
To: "Michael A. Puls II" <shadow2531@gmail.com>
Cc: public-html@w3.org
On 6/20/09, Michael A. Puls II <shadow2531@gmail.com> wrote:

> It seems like if the keypress is not one of "-+.e0123456789"
> (or "," instead of "." depending on the locale), then the keypress should
> be prevented.

that would not seem to be very useful for people who use IMEs or on
devices like mobile handsets with 12-key keypads instead of keyboards.
on my mobile, with a japanese IME, I have a few different choices for
typing in numbers; one of them is that I can press the あ/1 key
multiple times to cycle through choices, then press a second,
different key to confirm when  I've gotten to the number.

anyway, I realize the IME case is mostly like the paste case you
memtioned, but regardless, it would not seem prudent for the spec to
make any assumptions at all about what keys users should be pressing
to get a particular type of data into a particular input field. users
should be free to choose whatever way they want.
Received on Monday, 22 June 2009 08:58:50 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:49 UTC