Hi!

I'm new to the drupal_get_form function, and I can't seem to get it to work.

What I'm basically trying to do is merging two forms together. So I'm using the hook_form_alter hook
to get the first form, and then using drupal_get_form to fetch the other form, like so:

function my_module_form_alter(&$form, $form_state, $form_id) {

    switch ($form_id) {

      case my_node_node_form':
       
        // We're testing the drupal_get_form...
        echo drupal_get_form('my_other_node_node_form');
        exit()

        break;

}

However, this outputs nothing to the screen.

What am I doing wrong?

Comments

DrupalNovice’s picture

Any ideas anyone?

Have You got the drupal_get_form function to work? If so, could you share your experience?

DrupalNovice’s picture

After trying to get this to work a while now, I must admit that the drupal_get_form and drupal_retrieve_form are rather stupid.
I mean what's the use of these functions in the first place when they can't even do they're job right?

They only work properly if they are used on pages that output the form that they retrieve!

I guess I'll have to build a new form from scratch, and merge these forms that way.

Sorry, but these two was just a big disappointment...

DrupalNovice’s picture

Please forgive my inappropriate use of the english language, and see this page