New issue
Advanced search Search tips

Issue 662705 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 117378
Owner: ----
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

html5 input number doesn't allow maxlength

Reported by jasonrob...@gmail.com, Nov 6 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36

Steps to reproduce the problem:
1. Create an HTML5 form with number input. 

What is the expected behavior?
To limit the amount of characters like a text input.

What went wrong?
Browser ignores maxlength property.

Did this work before? N/A 

Does this work in other browsers? No

Chrome version: 54.0.2840.71  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 

Comment 1 by woxxom@gmail.com, Nov 6 2016

Input of type "number" doesn't support "maxlength" attribute according to the specification:
https://www.w3.org/TR/html5/forms.html#input-type-attr-summary
See also https://developer.mozilla.org/docs/Web/HTML/Element/input

Comment 2 by woxxom@gmail.com, Nov 6 2016

If you wonder why, it's because you can use "min" and "max" attributes that make more sense and provide more control for numbers. See the links in #1.

Comment 3 by tkent@chromium.org, Nov 6 2016

Components: -Blink>Forms Blink>Forms>Number
Mergedinto: 117378
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment