Email or username:

Password:

Forgot your password?
Top-level
Mark Koek

@simevidas seems to me that Safari's behaviour is correct -- but that it doesn't really matter as the maxlength attribute shouldn't be used to begin with, as it's trivially bypassed

4 comments
Nordern

@mkoek @simevidas That doesn't mean it shouldn't be used, it means it shouldn't be relied on. In the end the server should check everything, but limiting the characters in the input items itself gives more immediate feedback to the user.

Clicking something like submit and getting errors afterwards is an inherently unsatisfying user experience

DELETED

@mkoek @simevidas Disagree. maxlength should be used to help people avoid inputting strings that are too long.

But you should never depend on web form validations and restrictions anywhere else, especially server-side. As you say, they are trivially bypassed.

Saying not to use maxlength is like saying to not use dropdown menus because the user could alter the menu or the selected value before submitting the form.

Vivien the Trumpeting Elephant

@mkoek @simevidas This should not be a bug. This should be the default behavior for all browsers (and the server should check the length in the same way).

Sören

@mkoek @simevidas Safari *should* be correct, but the spec unfortunately does go by byte length (16-bit code units) rather than grapheme cluster count. infra.spec.whatwg.org/#string-

Go Up