I have created a custom module and have used 'hook_form' to create a custom form. I have then created a new page using menu callback and inserted this form on it
This form basically is to create nodes from the frontend. I have all the same fields as in the backend.
Form code:
function input_simple_form($form, &$form_submit) {
$form['title'] = array(
'#type' => 'textfield',
'#default_value' => '',
'#required' => TRUE,
'#title' => 'Title',
'#maxlength' => 1024,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
return $form;
}
How do I save this, or how do I tell the hook_form that this is for a specific content type? I know how to use node_save but not sure how I would implement this with the hook_form.
How do I go about achieving what I want?
Thanks Robert
Use in your callback function:
$my_form = drupal_get_form('input_simple_form');
echo $my_form;
if your are using hook_theme to theme your page parce $my_form as variable and print it in your template/theme file.