4 ms·
<input type="text" maxlength=80 /> would provide a better user experience
by Khao 12y ago
<input type="text" maxlength=80 /> would provide a better user experience
- Someone1234 12y agoWorse user experience. It chops off the end of pasted/bookmarklet titles.
- rbdn 12y agoOr something like: <input type="text" onInput="if(this.value.length > 80) { this.style.background = 'tomato'; } else { this.style.background = 'white'; }" />.
- onion2k 12y agoNo it wouldn't. Users who paste the title wouldn't be able to edit out the least relevant section of text without pasting it somewhere else first, editing it, and pasting the resulting modified text in. It's far better from a UX perspective to let the user do whatever they want without stopping them but inform them that there's a problem at the first opportunity. Ideally, in this case, there should be some JS to input events on the entry box that highlights the text that's over the limit. With all the server side validation as well, obviously. For an example, Twitter's entry box on their web app gives a character count in the bottom right but still lets you go over, but anything over 140 characters is given a background color of red. It's very clear to a user what the problem is.
- 3rd3 12y agoEverything you say has been said already.