W3C home > Mailing lists > Public > public-html@w3.org > July 2009

Re: <input type="number"> restricting user input to only valid characters

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 15 Jul 2009 21:59:01 +0000 (UTC)
To: "Michael A. Puls II" <shadow2531@gmail.com>
Cc: public-html@w3.org
Message-ID: <Pine.LNX.4.62.0907152157380.12284@hixie.dreamhostps.com>
On Wed, 15 Jul 2009, Michael A. Puls II wrote:
> 
> O.K., so if the UA ignores invalid input, you'll get "" or a previously 
> set valid number.
> 
> If the UA interprets invalid input as "", you'll get "".
> 
> So, O.K. No matter what the UA considers invalid or valid or whether it 
> sets invalid input to "" or ignores it or only allows valid input, 
> you'll either get a valid number or "" for the control's value. In that 
> case, a value of "" would mean that "the control doesn't currently have 
> a valid number set".

Right.


> I also wanted to see how interoperable it is if you check .value for "" 
> to see if the input in this case of type="number" is not valid. There's 
> validity.valid and the individual others and you can check validity of 
> the form, but if someone was just checking the value of the control to 
> see if it's valid (I feel that might be likely), then I wanted to see 
> how it'd work.

Right. There's no way to tell that the user entered something that the 
user agent is displaying but doesn't consider valid.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 15 July 2009 21:59:38 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:48 UTC