Part 1: Min Size Handling
Problem: A nice thing about non-CCK nodes is that you can set a minimum number of words required for the body field. This allows elimination of entries too small to meet site standards. However, CCK textareas have no way of setting minimum required size.
Solution: I suggest adding a minsize check, however done in characters, rather than words. There is already a widget configuration for max length and we need one for min length, plus validation code.
Part 2: Usability of Validation (Min/Max)
Problem: Right now when validating the max size, the status message does not show how many characters have been already submitted. Moreover, if the validation fails it takes another form submit to check if the entry is better.
Solution: Need to write out the entered # of characters into status message. Plus, consider adding JavaScript code to count characters in real time and display them OR pop a client side validation warning.
Comments
Comment #1
yched commentedI just set http://drupal.org/node/85254, where you already submitted the "min length" request, back to closed.
Aside from that, both points seem valid - patches anyone ?
Comment #2
dkruglyak commentedThanks, I created this new issue to reflect changes in status too.
I might try to fix this after all, but not sure how to create the patch file to contribute. Any suggestions?
Comment #3
yched commentedWhat exactly do you need help with ?
Comment #4
dkruglyak commentedCreating a patch file once I make fixes. What is the right setup / command options for this?
Comment #5
yched commentedIt depends on your OS, I guess.
You might want to check http://drupal.org/handbook/cvs, and mainly the "CVS GUIs and clients" section
Comment #6
dkruglyak commentedI run Drupal on CentOS 4.3 Linux and patch is installed. I was able to use it to apply patches, despite problems with uploaded Win files - since I do part of the actual development on Windows.
How do I generate patch files using command line on the Linux box?
Comment #7
yched commentedAh, that I don't know, I'm on windows (with TortoiseCVS)
I should be explained in the handbook I pointed you to, though
Comment #8
yched commentedActually, no, it's over there : http://drupal.org/node/22568
Comment #9
hedac commentedany luck of seeng the patch for minimum cck textarea validation ?
Comment #10
catchAssuming I've got the gist of this issue right this is still valid afaik - just needs a little js magic to warn users when they go over the character limit.
Drop task anyone?
Comment #11
dkruglyak commentedI suggest to expand this issue to cover all sorts of validation, not just field size and not just text area.
Perhaps this could rely on one of the available jQuery plugins and have pre-built validator for most common cases?
This needs to be designed to be highly configurable.
Comment #12
yched commentedThis is a feature request.
Comment #13
HS commentedMax length module does not work for CCK text areas on Drupal 6. I think this min and max character count feature needs addressing.