I have several content types created with cck module and what i am trying to do is to load any of this node forms after a user makes a choise in a select box in the same page. I have created a module with a block that contains the select box and when a user hits the submit button the apropriate node form appears. But without any theming at all, i see only all the elements of my selected form, but without any functionality i can't submit or validate the new data.
Snippet inside hook_block_form_submit looks like:
module_load_include('inc', 'node', 'node.pages');
$node_type='my_node_type';
$form_id=$node_type.'_node_form';
global $user;
$node->uid=$user->uid;
$node->name=(isset($user->name)?$user->name : '');
$node->type=$node_type;
node_object_prepare($node);
$output=drupal_get_form($form_id, $node);
print $output;I need to load my forms in place (i think in some specific id) in the same page with the select box, and of course with the correct theming. From the research that i have done, i can say that i have to use ajax code for the submit function. But unfortunatelly i dont know how can i do this... with ajax code. So if anyone can help me, or at least can give me some source with something similar would be very helpfull!!!