I'm trying to create a form that will create a new user and create a new node in one fell swoop. The node has been defined using CCK so that I could use the image upload widget. When I try to programmatically display the node field, the CCK widgets are not showing up. Here is the code I am using:

  module_load_include('inc', 'node', 'node.pages');
  $node = new StdClass();
  $node->type = 'performer';
  $form = node_form( $form_state, $node ) ;
  drupal_prepare_form( 'performer_node_form', $form, $form_state ); //Let all form hooks run
  $form_html = drupal_render_form( 'performer_node_form', $form );
  return $form_html;

Any ideas of a better way to set this up?
Thanks,
Jeff

Comments

ram_segal’s picture

Hey,

Is Your goal is to implement users with CCK fields?

jlyon’s picture

Hey,

No, more to submit two forms from one page. I want to have one page where a band can create an account and create a band profile, but I want accounts to be able to create more than one band profile. To do this, I am storing the band profile information in a separate node.

I want new bands to be able to sign up and create their profile from one simple page, so I am trying to create a custom module that displays both the user registration and the band profile cck form, and then I was going to submit both at once using drupal_execute. Am I going about this in totally the wrong direction?

Thanks,
Jeff

rsmith5’s picture

You could use the Form Block module to display the form http://drupal.org/project/formblock. You could also display everything nicely with Quick Tabs http://drupal.org/project/quicktabs.