W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2010

[whatwg] <input type=number> without keyboard editing

From: Dean Edwards <dean.edwards@gmail.com>
Date: Sun, 07 Nov 2010 21:53:58 +0000
Message-ID: <4CD71FF6.4090602@gmail.com>
On 02/11/2010 11:46, Diego Perini wrote:
> On Mon, Nov 1, 2010 at 3:31 AM, TAMURA, Kent<tkent at chromium.org>  wrote:
>> A team in Google tried to use<input type=number>  for a product, and they
>> decided
>> not to use it.
>> What they needed was a control to select an integer from a specific integer
>> range
>> such as 1 - 16. The number type control in Opera and WebKit allow a user to
>> input
>> out-of-range value even if the control has min=1 and max=16 attributes.
>> It's not
>> a good UI and the reason why they doesn't use type=number.
>>
>> They need a number control which
>>   - doesn't allow any keyboard / cut&paste operations and
>>    So, a text field part is read-only, but the spin-buttons work.
>>   - always has a valid value.
>>    "required" by default, and sanitization algorithm may be different.
>>
>> I'm not sure how to solve this issue.  Introducing new content attribute or
>> another number type?
>>
>
> I would have suggested using a standard "select" element for that.
>
> Seems to me it covers all of your requirements:
>
> - cut/paste not allowed
> - keyboard spinning
> - always valid
>
> even then, I wouldn't do that just to avoid server validation. :-)
>

Bah! I missed your reply and just posted exactly the same thing. :)

-dean
Received on Sunday, 7 November 2010 13:53:58 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:28 UTC