Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6549519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:06:10+00:00 2026-05-25T12:06:10+00:00

Hi Stackoverflow community, I am creating a voting system with many categories using the

  • 0

Hi Stackoverflow community,

I am creating a voting system with many categories using the FormAPI.

I built the form with drupal_get_form() and stored the html markup into a textarea in a CCK field. I also built the submit function which deals with the database.

However, when I display the node, the form can be construct however, the submission function is not called. I can’t figure out the source of the problem. Any advice is appreciated, thanks!

*EDIT:

Defines the form:

function judges_nodeapi(&$node, $op, $teaser, $page) { 
switch ($op) {
    case 'view':

        ...

        $node->field_judging_form[0]['value']=drupal_get_form('judges_entry',($node));

        node_save($node);
}
}



  function judges_entry($form_state, $node){
    ...
    return $form;
}

Then I’m simply using CCK to display the form as plain text.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:06:10+00:00Added an answer on May 25, 2026 at 12:06 pm

    Each time you call drupal_get_form() a new token is generated (for security reasons), so you can’t render a form statically into a field and expect it to ever work.

    What you need to do is get a fresh version of the form every time you display it by implementing hook_preprocess_node and then outputting the form in your template file. Something like this in your module file:

    function MYMODULE_preprocess_node(&$vars) {
      $vars['my_form'] = drupal_get_form('judges_entry',($vars['node']));
    }
    

    Then in your template file (node.tpl.php):

    echo $my_form;
    

    Hope that helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello StackOverflow community, Using Google App Engine, I wrote a keyToSha256() method within a
Dear members of the Stackoverflow community, We are developing a web application using the
Hello StackOverflow community, The air.swf file referenced here: http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html used to launch AIR applications
I am creating an 'award' system for my website to encourage a community fealing,
Hi stackoverflow community, i'm using RKObjectManager to make iOS RESTful requests to map responses
Hey stackoverflow community! I'm having an issue where a highly involved algorithmic program is
Hello stackoverflow community ! I am trying to figure out how to architect my
Want to know what the stackoverflow community feels about the various free and non-free
Stackoverflow is built on MVC and does a bunch of simple but nice things
I'm wondering what the Stack Overflow community thinks when it comes to creating a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.