I'm trying show on views (each row) my custom form. It works, but the form doesn't work proper. I need to give to each form different ids.
hook_forms should help me, but I cannot manage how to use it. If I put print $form into it, I still cannot see my forms.
I'm calling my form like this from the template file:
$form1 = drupal_get_form('votingform_create_decision_form_' . $node->nid开发者_如何学JAVA, $node->nid);
print drupal_render($form1);
Now I got it working:
function hook_forms($form_id, $args) {
if ($args[0] == 'mymodule_form_') {
$forms['mymodule_form_' . $args[1]] = array(
'callback' => 'mymodule_form',
'callback arguments' => array($args[1]),
);
}
return $forms;
}
精彩评论