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

yched’s picture

I 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 ?

dkruglyak’s picture

Thanks, 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?

yched’s picture

What exactly do you need help with ?

dkruglyak’s picture

Creating a patch file once I make fixes. What is the right setup / command options for this?

yched’s picture

It depends on your OS, I guess.
You might want to check http://drupal.org/handbook/cvs, and mainly the "CVS GUIs and clients" section

dkruglyak’s picture

I 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?

yched’s picture

Ah, that I don't know, I'm on windows (with TortoiseCVS)
I should be explained in the handbook I pointed you to, though

yched’s picture

Actually, no, it's over there : http://drupal.org/node/22568

hedac’s picture

any luck of seeng the patch for minimum cck textarea validation ?

catch’s picture

Title: Improved handling for textareas » Live textarea maxlength validation
Version: 4.7.x-1.x-dev » 6.x-1.x-dev

Assuming 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?

dkruglyak’s picture

Title: Live textarea maxlength validation » Live JavaScript validation of fields
Component: text.module » Usability
Category: feature » task

I 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.

yched’s picture

Category: task » feature

This is a feature request.

HS’s picture

Max length module does not work for CCK text areas on Drupal 6. I think this min and max character count feature needs addressing.