3 ms·
Not sure if this is a title length restriction on HN, but the omitted "...when pasted into..." here seems important.
by 0x0000000 6y ago
Not sure if this is a title length restriction on HN, but the omitted "...when pasted into..." here seems important.
- 1f60c 6y agoAnd "a password field" also.
- Someone1234 6y agoThat's their justification, not a restriction on the change, this impacts non-password fields too.
- lucb1e 6y agoYeah that's the weird thing. They write "for password fields" and then apply it to non-password fields and even multi-line fields. Have you ever seen a multi-line password field?! I understand that people might abuse <textarea> for it but that's definitely not the common thing and just crazy talk. It's an excuse but I don't understand the reason behind this change. I've been setting maxlength to generous values on my fields in applications since I started coding HTML, if now suddenly I have to revisit everything and add JavaScript magic to check form validity where previously the page was completely free of JS, well, I think I'd frankly refuse where possible and tell people to complain to their faulty implementation.
- garaetjjte 6y agoEh? For what reason you need to add JS? Forms won't submit with overlong text.
- lucb1e 6y agoOh the change is that it'll not cut the user off but show a warning instead? I misread the post then. Edit: Yes, indeed: > The form cannot be submitted until the user fixes the error, so the server shouldn’t receive an excessively long text Thanks for pointing that out!
- Wowfunhappy 6y agoI imagine the goal is to make behavior consistent instead of adding weird exceptions.
- tomsmeding 6y agoAt the risk of stating the obvious, and sorry if so: doing input length validation client side is very useful for the user's experience, but the server should always validate this too. "... now suddenly I have to revisit everything and add JavaScript magic to check form validity ..." sounds suspiciously like you were relying on client side form validation without server validation, I hope that's not the case. :)
- lucb1e 6y agoIt prevents server-side errors, which I don't handle as gracefully. When the client sends content that it shouldn't have been able to send (i.e. someone tampered with the form) and the server bails out, I don't always bother making it pretty. I'm well aware of the risks in client-side validation, but indeed, as I see in my job often enough (I'm a security consultant), it's a valid remark that not everyone has taken to heart quite yet so thanks for the comment :)
- tomsmeding 6y agoAh yes, preventing uglier server-side errors is indeed a very valid reason. :)
- dang 6y agoSeems like "when pasted" can be squeezed in.