Page MenuHomePhabricator

maxlength html form values are not used in preferences
Closed, DeclinedPublic

Description

e.g. preferences -> Editing -> columns has a maximum value of "1000" and should have a maxlength="4" since any value over 1000 will cause an error. While this still does not solve for any 4 digit number greater than 1000 being entered and causing an error it will give users an idea about the scale of the number needing to be input.

instances in prefs where this issue is present:

Editing -> columns | maxlength="4"
Editing -> rows | maxlength="4"

Recent changes ->Days to show in recent changes | maxlength="2"

watchlist -> Days to show in watchlist: | maxlength="2"


Version: unspecified
Severity: minor
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=71026

Details

Reference
bz70974

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:52 AM
bzimport set Reference to bz70974.
bzimport added a subscriber: Unknown Object (MLST).

input type="number" does not support maxlength (https://html.spec.whatwg.org/multipage/forms.html#concept-input-apply), since you're meant to use min/max instead (which would also address your point).

However, we currently blacklist them, since it reportedly has a bad user experience (you're blocked from submitting, but you don't know why) in some browsers. I've opened bug 71026 so we can re-evaluate this, when either there are no "current enough" browsers with the bad behavior and/or we can polyfill it.

Other than that, the only option would be to change it from number to text, but that's a little hackish (and still doesn't solve the min/max).

Aklapper closed this task as Declined.Aug 31 2019, 11:42 PM
Aklapper added a subscriber: Aklapper.

Declining as per last comment and in favor of T73026.