W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2013

Re: [whatwg] Can the maximum allowed value length be changed to restrict the number of characters?

From: Ryosuke Niwa <rniwa@apple.com>
Date: Mon, 19 Aug 2013 16:40:08 -0700
Message-id: <1B21ECBF-54C4-4492-B1AC-0B05430026C0@apple.com>
To: WHAT Working Group <whatwg@lists.whatwg.org>
Cc: Kent Tamura <tkent@chromium.org>, Alexey Proskuryakov <ap@apple.com>
On Aug 19, 2013, at 4:30 PM, Ryosuke Niwa <rniwa@apple.com> wrote:
> http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#maximum-allowed-value-length
> 
> Why is the maxlength attribute of the input element specified to restrict the length of the value by the code-unit length?
> 
> This is counter intuitive for users and authors who typically intend to restrict the length by the number of composed character sequences.  In fact, this is the current shipping behavior of Safari and Chrome.
> 
> Can the specification be changed to use the number of composed character sequences instead of the code-unit length?

Also, http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#the-maxlength-attribute says "if the input element has a maximum allowed value length, then the code-unit length of the value of the element's value attribute must be equal to or less than the element's maximum allowed value length."

This doesn't seem to match the behaviors of existing Web browsers or http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#maximum-allowed-value-length unless I'm misreading something.  Namely, the value attribute set in the markup or by script isn't automatically truncated at the element's maximum allowed value length.

The paragraph should be revised to mention and only mention that the maxlength attribute affects the validation and the user agents may prevent the user from typing more characters than the specified value.

- R. Niwa
Received on Monday, 19 August 2013 23:40:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:23 UTC