[Bug 13769] WF3: Add trim="" attribute to <textarea>, <input type=text/search>, <form>, and <fieldset> (applying to all contained fields of appropriate types) that strips leading and trailing whitespace from the value

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

--- Comment #34 from Marat Tanalin | tanalin.com <mtanalin@yandex.ru> 2011-10-12 22:55:08 UTC ---
(In reply to comment #32)

> Do you have examples of pages that trim the contents of textareas before
> submission today? I would be interested in studying such pages to see how they
> handle this issue.

http://foxconn.ru/company/feedback/

> Are there real Web pages (not demo pages
> created for this bug!) that show that authors group input fields that they trim
> into fieldsets, such that the trim="" attribute on <fieldset> would help them?

It seems we've somewhat beared off the initial bug-point. Grouping is not about
trimmed elements at all. _Required_ fields are grouped.

The whole point of 'trim' attribute is to use in conjunction with 'required'
attribute. We don't need to alter data actually sent to server (we do trimming
on server-side). We need to just prevent sending required fields that contain
whitespace-only as their values.

Embedding trimming feature into 'required' attribute functionality itself is
not enough flexible for you, OK. Then 'trim' attribute gives us that enough
flexibility.

Again: we do NOT need to alter values sent to server at all.

All the bug is about is to treat whitespace-only values identically to
literally empty values.

For descriptive reasons, I've created demo page that emulates expected
functionality with JavaScript:

http://tanalin.com/_experimentz/bugs/w3/html/trim/required/

The demo page contains form with two fieldsets. First of the fieldsets has
'required' attribute specified and is used to group required fields together,
while 'trim' boolean attribute (also specified for the fieldset) says browser
to treat whitespace-only values of descendant fields invalid exactly as
literally empty values are.

P.S. By the way, should I file a new bug dedicated to adding 'required'
attribute to 'fieldset' and 'form' elements (one more clever feature to
generalize forms, fieldsets, and form fields), or we could discuss that in
current topic?

Thanks.

-- 
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 Wednesday, 12 October 2011 22:55:19 UTC