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

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 02 Nov 2010 21:58:07 -0400
Message-ID: <4CD0C1AF.6080700@mit.edu>
On 11/2/10 3:57 PM, Aryeh Gregor wrote:
> If the user enters a value of 100 in<input type=number max=50>, then
> it seems perverse to tell them "The maximum allowed value is 50" so
> they have to go back and fix it.  It makes more sense to just
> automatically clamp it to 50.  Unless the user happens to be
> submitting the form before unfocusing the input, they'll see that it
> got clamped and can fix it if that's wrong, but in practical cases it
> should almost always be right to clamp out-of-range input, and to
> round input that doesn't match the step.  (If the author doesn't like
> it in some particular case, they can use a simple event handler
> instead of max="".)

This is difficult to do in practice.  Consider:

  <input type="number" min="20" max="50" value="20">

The user now wishes to input 30 instead of the default value of 20. 
What steps need to be taken to do this, and how does the input control 
react to those steps?

I agree that things are simpler if only one of min and max is specified.

-Boris
Received on Tuesday, 2 November 2010 18:58:07 UTC

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