Make WordPress Core

Opened 7 years ago

Last modified 7 weeks ago

#40610 accepted defect (bug)

HTML5 Validation error in Screen Options > Pagination

Reported by: arena94's profile Arena94 Owned by: joedolson's profile joedolson
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch has-screenshots
Focuses: Cc:


Error: Attribute “maxlength” is only allowed when the input type is “email”, “password”, “search”, “tel”, “text”, or “url”.

Attachments (1)

#40610.patch (781 bytes) - added by Arena94 7 years ago.

Download all attachments as: .zip

Change History (8)

7 years ago


#1 @Arena94
7 years ago

  • Keywords has-patch added

#2 @afercia
7 years ago

  • Keywords has-screenshots added
  • Milestone changed from Awaiting Review to 4.8
  • Version trunk deleted

@Arena94 thanks for your patch.

Looking back for some history, this input type was changed from text to number in [20168], see #17863. Seems the maxlength attribute was kept for some backwards compatibility concerns. However, the next 4.8 release is going to drop support for old IEs so maybe worth considering to remove it.

Worth noting seems browsers have all sorts of different behaviours, most of them allow to enter more than 3 characters ignoring the max="999" and maxlength="3" attributes when manually entering numbers, regardless of the presence of the attribute (it only works when the input type is text).

As far as I see, removing maxlength="3" makes some difference just in IE11 and Edge. With maxlength="3" it's not possible to manually enter more than 3 numbers. Without maxlength="3" it becomes possible. It is always possible when the entered value starts with an alpha character.

Chrome Mac (doesn't honor max and maxlength when manually entering numbers)

Firefox Mac (doesn't prevent alpha characters input, doesn't honor max and maxlength when manually entering numbers)

IE11 (doesn't prevent alpha characters input, doesn't honor max and maxlength when entering a mix of alpha characters and numbers)

Edge (same as IE11 plus doesn't honor max when incrementing the field value using the up arrow)

Moving to 4.8 consideration.

#3 @afercia
7 years ago

Related: #37004.

This ticket was mentioned in Slack in #core by obenland. View the logs.

7 years ago

#5 @obenland
7 years ago

  • Milestone changed from 4.8 to Future Release

#6 @ocean90
4 years ago

#47530 was marked as a duplicate.

#7 @joedolson
7 weeks ago

  • Milestone changed from Future Release to 6.5
  • Owner set to joedolson
  • Status changed from new to accepted

This is pretty trivial; let's resolve it.

Note: See TracTickets for help on using tickets.