I need to create a form in the view (not in the edit) of a content type A. This form need to submit the data to a content type B.
I notice that node/<nodeID/edit
is the "action" of the form which let you edit a node. But if I put the same action in my form on A it shows me the editing node page of B.
My form is as simple as:
<form action="xxx">
<input type="text" name="cck_field_to_be_added_in_B" value="foobar">
</form>
Setting the xxx action isn't enough, because the FAPI requires form_id and other stuff... So, How can I build a form which is "correct" and sends the data in the rigth way?
Any idea?
----EDIT----
Using the rimian solution it worked. Heres are the dettails:
I needed the form in the view of a node created with CCK. So I have my module with two functions:
function getForm(){
return drupal_get_form('buildForm');
}
function buildIngredientsForm(){
$form[]... //bla bla bla build the form
return $form;
}
Because I want this inside a cck content, than I can "hack" the theming system of CCK. Here explain how: http://drupal.org/node/206980
Now, whenever you wats to display your form just call print mymodule.getForm();
and the magic is done.
Regards, Segolas