molily: html5 Forumular: input type="number"

Beitrag lesen

<input type="number" size="4" maxlength="4" id="svnr" name="svnr" value="" tabindex="4">,

dann meldet der w3c Validator "Attribute size not allowed on element input at this point." und " Attribute maxlength not allowed on element input at this point.".

Warum?

Unbefriedigende Antwort, aber: Weil das so spezifiziert ist.
http://www.w3.org/TR/html5/forms.html#concept-input-apply
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#concept-input-apply

Warum das so entschieden wurde, lässt sich vielleicht in den HTML WG Issues, auf der HTML-WG-Mailing-Liste oder beim der WHATWG-Pendant recherchieren.

Validator.nu, das ist die Engine hinter dem neuen W3C-Validator, spuckt auch eine entsprechende Fehlermeldung aus: maxlength und size sind nicht auf type=number anwendbar.

Mathias