[Bug 13769] Whitespace-only values should be considered empty in required form fields

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13769

--- Comment #10 from Marat Tanalin (tanalin.com) <mtanalin@yandex.ru> 2011-09-03 23:14:53 UTC ---
(In reply to comment #9)
> (In reply to comment #5)
> > The question to me is how common is it to have a required field where
> > white-space only is a ok value? It seems to me that this would be a very rare
> > edge case.
> 
> How common is it to have a required text field where a single period is an ok
> value? Or a single dash? Or the string "no answer provided"? Or a non-breaking
> space?

Whitespace has one fundamental distinctive: whitespace is INVISIBLE exactly
like empty string (and unlike nonwhitespace characters that can be manually
typed-in from keyboard -- like period or dash you mentioned).

That's why whitespace is always trimmed on server-side before server-side
validation on any well-developed website. Client-side validation should be just
consistent with server-side one.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Saturday, 3 September 2011 23:14:56 UTC