I have a content type, 'A'. Now I need a form with the user registration form fields plus the 'A' creation form fields. So when the user (annonymous) submits this form, a user and a node of type 'A' with the filled information would be created.
I have this for now:
function my_module_menu() {
$items['create_node_and_user'] = array(
'page callback' => 'user_and_node_creation_form',
'type' => MENU_CALLBACK,
'access callback' => TRUE,
);
return $items;
}
function user_and_node_creation_form() {
module_load_include('inc', 'node', 'node.pages');
$output = array();
$output['user'] = drupal_get_form('user_register_form');
$output['node_type_a'] = node_add('node_type_a');
return $output;
}
The form is displayed fine, but How can I add a submit handler to manage the node creation after register the user?