W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2010

[whatwg] Form Validity Ambiguity - patternMismatch

From: Joseph Pecoraro <pecoraro@apple.com>
Date: Mon, 19 Apr 2010 23:19:02 -0700
Message-ID: <507A350C-01BE-4532-B86A-7191A8195A56@apple.com>
The section describing the pattern attribute does not explain that
it only applies to particular input types [1].

However, one of the tables showing which content attributes apply
to which input types shows the pattern attribute only applies to
particular input types. Namely text, search, url, telephone, email,
and password but not dates, times, numbers, hidden and others:

This disconnect could lead to ambiguous implementations of
ValidityState's patternMismatch which is simply described in
multiple places as:

  [[
    When a control has a value that doesn't satisfy the pattern
    attribute.
  ]] [3]
  

  [[
    returns true if the element's value doesn't match the provided
    pattern; false otherwise.
  ]] [4]
  

These two definitions of patternMismatch do not mention that
they only apply on input type's that the pattern attribute applies
to. If that is the case then I recommend clarifying that constraint
in the description of the pattern attribute [1] and when describing
patternMismatch [3][4]. If that is not that the case then I don't
see the purpose of the table showing that the "pattern" attribute
only applies to particular input types, and I would like clarification
there (like the row being removed or all checkboxes?) [2].

This may also apply to other validity states as well, I haven't
checked others yet.

Cheers!
- Joe

[1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#attr-input-pattern
[2]: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#the-input-element
[3]: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#suffering-from-a-pattern-mismatch
[4]: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#the-constraint-validation-api
Received on Monday, 19 April 2010 23:19:02 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC