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

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