Very nice little module that does what it say on the tin.

It would be real nice if it was possible to set a min length value as well as that is sometimes useful.

Comments

browlands’s picture

I agree, for example creating a view for a product listing, and I need the text to be at least 2.3 to 2.7 lines long on the output view, a minimum character length would almost ensure the output is nicely formatted (unless the user enters a sentence containing lots of wide capitalised characters like W and M, which is highly unlikely.)

On another note, the ability to disallow line breaks and carriage returns would also be a nice feature especially for multi-line text cck fields.

Also, a "fill with lorem ipsum for min. characters" and a "fill with lorem ipsum for max characters" feature would be good for developers, whereby the input field would be filled with a random extract from a text file containing the latin garbage. No more cut and pasting.

fourmi4x’s picture

Suscribing, it would be great to have be able to set a minimal length indeed.
I can't even find some php snippet to do this!

dawehner’s picture

This seems to be somehow out of scope of this module.

fourmi4x’s picture

Sure, the name would have to be changed...!! But would this require a new module? Could the "countdown" feature be reused and inversed?
I'm really don't know, but if it was to be done, would'nt this module be the easiest starting point for doing it?

tsvenson’s picture

@derine: I only partly agree with you. Yes, the module is called Maxlength and thus setting a Minlength on a string might sound out of the scope. However, the min length is optional, while the max lenght is required.

I can see lot of use for this such as in page titles, meta description field, body fields etc where you want to make sure that the writer is filling in enough information to make the text content in that field usable.

Take a profile page where you can fill in various information about yourself. Often you want to limit the amount of characters a user can type in due to how that field is used on the site. But at the same time you want to ensure "lazy" users don't just type in "my bio" in the bio field.

Thus as would see the min length option as a great optional complement to the required max length setting to help site builders implement "enforcing" guidelines for how the site is used.

But I also see it very useful for those who will fill in the information as they wont have to read any guidelines or remember the right way of creating content.

To make it even better, the counter could even have a different colour when the character count is less than the min length as well.

alliax’s picture

This is obviously as tsvenson said it! Would be so very useful for guiding users to the correct way:
minimum and/or maximum limits, in characters and words

I hope you all have been thinking how to do it and good luck!

mikefyfer’s picture

Does this module have support for minlength (for D7)? I can't find it anywhere, but this issue -> http://drupal.org/node/428636 mentions minlength and that it exists for this module in D6 at least.

Any help is appreciated.

mikefyfer’s picture

For anyone wondering, this module might be an option for you as well...

http://drupal.org/project/field_validation

jcsnyder’s picture

Could we re-open the discussion about bringing min-length to this module? I would be happy to sponsor it.

webmetod’s picture

Issue summary: View changes

#8 works fine. Thanks for the tip.

cedewey’s picture

Status: Active » Closed (works as designed)

The Drupal 6 version of Maxlength is no longer supported so I'm marking this Closed (works as designed).

I also encourage you, if you haven't already, to upgrade your site to Drupal 8/9. We are actively maintaining that version and you would enjoy all of the other features of the latest version of Drupal.