This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to validate for max length in textarea?

I'm almost done making seperate teaser and body input areas so that I can eliminate the need for the break command by using the excerpt and contemplate modules. All I need to do now is add a maximum word and/or character check/limit the length of the teaser's textarea.

Unfortunately, I've discovered that "textareas" unlike "textfields" (used for much short text entry purposes) do not allow adding the "maxlength" attribute to your form, and the excerpt.module apparently bypasses the normal teaser length controls which Drupal provides (even tried to use a couple contrib modules which said they added teaser control and those didn't work either).

Searching online, most of the solutions I've found involved javascript, but this doesn't seem to be a good solution for any number of reasons. My best lead so far has come from, surprise - here - but I can't figure out how to intergrate it into what I'm working with.

So, basically am trying to add something with the logic similar as this:

<?php
function myform_validate($form_id, $edit) {
  if (str_word_count($edit['text']) > 200) {
    form_set_error('text', t('Woops! Too many words'));
  }
}
?>

to the code for the excerpt module which looks like this:

function excerpt_nodeapi(&$node, $op, $arg) {
switch ($op) {
case 'validate':
if ($node->teaser == '') {
form_set_value($arg['teaser'],isset($node->body) ? node_teaser($node->body, isset($node->format) ? $node->format : NULL) : '');

beta testers needed for new front_page.module (new features include front page by role)

Hi guys.

Anyone with a Drupal 4.7.x test site that is willing to help test updates to the front_page.module appreciated. There are 2 new features:

Aggregator2 - way to disable "delete feed items after..."

Can anyone help me determine which lines of aggregator2.module to comment out so that it will never delete feed items?

I always keep the option for feed item deletion at "Never", but for whatever reason, all my feeds deleted all my feed items. I checked out the feed options, and everyone had the "delete feed items after" option changed. I have no idea how this occurred.

Regardless, I never want my feed item nodes deleted, so I'd prefer to prevent this from ever happening again by disabling that feature.

Please help if possible.

categorization

Hello!

I have not so small service based on Drupal - www.muzyczna.pl.
Now I would like to organize my content much better. I would like to give category to all of it (articles, book, reviews, links etc.).
Do You know how to do it? I would like to do like this: I read an article about e.g. Radiohead and in the block (right column) I could see links for last articles about this band, links, reviews and books.
I will pray for you if you will help me.
Please. It is very important for me.

Thank You...

Need help in Webform Module

I would like to add Radio Buttons and Check Boxes to the Webform. How can i do that?

Need help on moviereview module

I have a problem on using moviereview module. And this is my first time to use this module.
I had created a moviereview content in my website. It had been published directly. But when I log out from the site and view it as anonymous user, the image (URL Link) and synopsis become unavailable. The content can only be seen as the original creator or admin. It seems it's the permission problem. I checked the Access Control, the "Access Moviereview" right had been granted to anonymous user already.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions