Improve user-experience: character limit on form input fields
When I try a form, I always get tempted to overfill title fields... Sometimes, there is no form validation and I get an Oracle error. This is too frustrating. I know that one solution is validating the forum elements (server-side). But it's also frustrating to get one or more error messages when you think you were finished. Sometimes the problem is not the database itself but a system/information/whatever requirement about a short char limit (i.ex. telephone number... or something like that)
Column with that restriction are, usually, keys, some titles (not forum messages titles), group name, forum name...
It could be nice if the user could be warned somehow before posting (client-side). Note that that is also usefull for mandatory fields.
The simplest idea is using the MAXLENGTH value on input fields, so the browser didn't let the user write any more.
We have talked about that today on irc, I'm going to write here a summary of the best ideas, in fact, all of them...
<cite>–Maxlength value is not necessarily better its just a different bad experience
you have to check in the validate block
in fact all text columns should check for length.
All I do is use text which is like 4gb size on postgresql</cite><cite>–Users should know what does stop writing mean, but it could be nice to have some javascript working on character counting.</cite>
<cite>–add a beep if you break the limit
–beep alone is not useful,
need to give visual feedback</cite>
<cite>–js in the standard form?
–Yes, it's a feature you can turn on/off</cite>
<cite>–The JS is nice to have check before submit and then a validate error on backend. so if you don't have JS it tells you in the standard form error.
<cite>–The javascript could show something like "Max 100 chars, X remaining" while user types. that should be done in message key though problem is maintaining it. Or having some sort of extra help text ie: help_text + "acs-templaing.max_length_message".</cite>
<cite>–Informing before in the help text would be useful from the user perspective too</cite>
<cite>–Show a warning only when users reaches a threshold, i. ex. 90 chars "Ey! you write a lot! only X chars remaining". I've seen on twitter.com, that you can write over the limit, then the counter become red.</cite>
<cite>–We can do all that, the idea is to make it a attribute of the form element</cite>