[whatwg] Constraint validation feedback (various threads)

Mounir Lamouri mounir.lamouri at gmail.com
Tue Nov 16 07:38:11 PST 2010


On 11/16/2010 04:35 PM, Anne van Kesteren wrote:
> On Tue, 16 Nov 2010 16:04:08 +0100, Mounir Lamouri
> <mounir.lamouri at gmail.com> wrote:
>> There is a LinkedIn form broken because of that: there are two fields
>> with a non-HTML5 placeholder (ie. it's the value) which is set with
>> .value="something" but the field has a maxlength set to 4 (it's a year).
>> With a checkbox checked, one of this field will be hidden, with a value
>> greater than the maxlength making the form always invalid.
> 
> Actually, that specific problem was addressed long ago based on feedback
> from us:
> 
> "Constraint validation: If an element has a maximum allowed value
> length, and its dirty value flag is true, and the code-point length of
> the element's value is greater than the element's maximum allowed value
> length, then the element is suffering from being too long."
> 
> The "dirty value flag" is only true when the user has edited the control.

Actually, not:
"
value
    On getting, it must return the current value of the element. On
setting, it must set the element's value to the new value, set the
element's dirty value flag to true, and then invoke the value
sanitization algorithm, if the element's type attribute's current state
defines one.
"

http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-value

--
Mounir



More information about the whatwg mailing list