W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2006

[whatwg] [WF2] type=number and leading zeros

From: Henri Sivonen <hsivonen@iki.fi>
Date: Mon, 20 Mar 2006 17:03:15 +0200
Message-ID: <6CBFEFF6-A0AD-47BA-B9EA-C46F4AC3009E@iki.fi>
On Mar 20, 2006, at 16:15, Hallvord R M Steen wrote:

> Is it against the "idea" of input type="number" to send leading zeros
> if the users type them?

I think it is at least against the idea of input type="number" to  
give significance to leading zeros, so it should not matter to the  
server-side app developer whether the leading zeros are dropped in  
the browser or in a (hypothetical) server-side form processing  
framework that gives typed data to the server-side app.

> Some pros and cons:
> - server parsers may interpret leading zeroes as octal values
> on the other hand

Then the server would be broken.

> - if the field is for a post code, CC number, etc. leading zeros might
> be required

In my opinion, zip codes should not be treated as integers but as  
strings restricted by a regexp pattern to the local convention (if  
the locality is known; unrestricted if not).

Henri Sivonen
hsivonen at iki.fi
Received on Monday, 20 March 2006 07:03:15 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:45 UTC