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

Form Validation and Presentation

Hello,

I'm trying to add a new module that presents a new node type called 'article.'

This is different from the default story/page nodes in that it should have an additional form field that takes an integer. This integer corresponds to the vBulletin Thread ID where users can comment on the article. (Assumes that the thread is already created)

First, I need to validate that the number in the field is an integer. But I wanted to test to see if my validation code is getting picked up at all by first setting the field to not required, and then the logic to return an error if a single 'x' character is entered. Unfortunately, it didn't seem to pick up on this and so my validation code isn't working. Here it is:

/**
* Implementation of hook_form().
*/
function article_form(&$node) {
$form['title'] = array('#type' => 'textfield', '#title' => t('New WDS Article Title'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5);
$form['body_filter']['body'] = array('#type' => 'textarea', '#title' => t('WDS Article Body'), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE);
$form['body_filter']['format'] = filter_form($node->format);
$form['forum_link'] = array('#type' => 'textfield', '#title' => t('Associated Thread ID'), '#forum_link' => t('Thread ID'), '#required' => TRUE, '#default_value' => t(''), '#weight' => 2);

Want Little help

Hi I m Mayank Jaitly and I m new in drupal and i m trying to devlop the site and I have created the sign up form in that but I want it split it into three pages and can anybody tell me that how it is possible.

the site url is : www.mastechindia.com/final

UIEForum module not behaving with Drupal security contexts??

Full disclosure: Newbie... but I RTFM all the time, so hopefully not wasting yer time here.

Installed and configured uieforum with no problem in sites/defaults/modules/... It's awesome. I configured access rights so that authenticated and anon users can view forum. I disabled the old forum system.

If I log onto my site and click on various primary menu items, everything works fine.

Categories and catagorizing news for new news site help please!!

Hello, i am currently working on a new news site located at http://canadafreepress.com/dani/drupal

now if you look to the left you will see the navagation with a few drop down menus. Now if you look in those drop down menus you will see different sections.

The issue i face is hooking up those sections with a dedicated page were content can be posted. So if i post a story/news, i want to be able to post it to only front page, or only science and technology section.

return value

I want to print value of database table field {table_name}:

function my_list() {

$retval = '';
$retval .= '

    ';

    $result = db_query("SELECT table_name from {table}");
    while($tid = db_result($result))
    {

    $retval .= "

  • $tid
  • ";
    but this loop is never ending :)
    echo $retval;
    }

    $retval .= '

';

return($retval);

}

function my_funct2() {

$content = my_list();
echo $content;
}

My date won't save, please help

OK, I'm pretty tired, so I need someone else to help me sort this out.

I'm trying to store a date in ther format "2006-11-02" into a MySQL database DATE column,
I have a #date field in my form and create the string in hook_verify from the array, and I pass this string in my INSERT and UPDATE statements, via db_query, which I suspect reformats it somehow.

Please help me save my date!

Pages

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