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

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
http://hsivonen.iki.fi/

Received on Monday, 20 March 2006 07:03:15 UTC