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

On Sun, Oct 31, 2010 at 7:31 PM, 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?

Do you really want to disallow keyboard editing, or do you just want
to disallow entering an out-of-range number? The latter should be
prevented by a proper implementation of <input type=number>. If that
is not the case in webkit or opera then I suggest you file bugs on
those implementations.

If you really want to disallow editing then maybe what you want is
<input type=range>. If not then I'm wondering how common that type of
input widget you are requesting is. It might not be common enough that
it really warrants direct support in HTML. You can always use
javascript to build such a widget, ideally in combination with <input
type=number>.

/ Jonas

Received on Monday, 1 November 2010 00:15:46 UTC