I have a content type with a title that shouldn't be more then 10 characters long. This title field is read only.
What is the recommended way to limit the length of that title to 10 long?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityTry Maxlength module to do this.
Maxlength allows you to set maximum length of any field on any form making use of the form API. This includes fields created using the UI. (Example: any text field on a node) In D6 Maxlength allows you to set maximum lengths to the body, title and CCK textfields of any content type (node).
When the maximum length is enforced for a field, while editing content of that type some Java Script will countdown how many characters are left, also if the Javascript is turned off, it falls back to form API validation.
Automatic Nodetitles : I haven't try this. Try once, hope this module solve your issue.
"auto_nodetitle" is a small and efficient module that allows hiding of the content title field in the form. To prevent empty content title fields one can configure it to generate the title by a given pattern.
There is now a module available that provide min/max character and word length options. It's called Node Title Validation and allows you to customize the title attributes for each Content Type independently.
I found a solution with a sub module called Property Validation in the field validation module, after reading this comment.
And I added a jquery line to resize the node title.
$('.page-node-add-conteneur #edit-title').attr('size',10);