[whatwg] Default values for step

Will Levine wlevine at gmail.com
Fri Jun 25 11:43:58 PDT 2004

On Fri, 25 Jun 2004 15:45:43 +0000 (UTC), Ian Hickson <ian at hixie.ch> wrote:
> > I would guess that more forms on the web would require integers than
> > not, but many will need fractional values and it doesn't seem to make
> > sense to constrain the type (by default) based on this.
> Well, the idea is to make the most frequent cases the easiest to do.
> Since most cases will want integers, the default is integers.
> As you point out, authors can easily change the step to any:

Right now, my mind is stuck and I can't think of any uses for a number
input outside of an order form (which would require integers the
majority of the time), but I am sure that there must be many forms
that wouldn't want only integers. Constraining input by default
doesn't seem like the right solution. For date and datetime, you can
submit years with more than four digits. Why don't we constrain the
years in dates by default? I think planning 8000 years in advance is
less common then allowing non-integer input. Dates far in the future
(or in the past) would probably frustrate most scheduling programs
like fractional numbers would screw up the ordering program.

> Well, "any" seems like the value that is least likely to be useful. Again,
> the default is being chosen in such a way as to be the most useful
> default, so that for the most common cases, the author doesn't need to set
> it. I think authors would be surprised if the default time control allowed
> precision to the millionth of a second!

That is true.

One thing I didn't think about is that whatever widget the UA chooses
to display for time with step=any could be awkward (obviously this
awkwardness would still exist if the author specified step=any, but I
don't see that happening very often). The default widget shouldn't
look like that so I guess it does make sense to have a default step. 1
minute or 5 minutes would make sense. Since you know specific use
cases, you probably have a better idea of what is right.

Is there any time one would need to be precise to the second in a Web
app or are you just including the stuff about seconds and fractions of
seconds because you want to use an existing standard? Will using this
standard make it easier for server-side scripts to parse the
date/time? If we do need to use this existing standard, could we just
ignore seconds and tell the UA to only ever ask for time precise to
the minute and just submit that time with 00.0 seconds? This would
seem ideal to me. I can think of a few cases where time in seconds
would be important, but nothing that one would put in a Web app.

-Will Levine

More information about the whatwg mailing list