Drupal 7: Populate node fields with values from $form

413 Views Asked by At

I would like to know if it's possible to populate a node fields with the values from form_state or something like that.

Basically what I do is to show a register form merged with a form from a Content Type. I do that by using field_attach_form(). Now on submit I create a node using:

$node = new stdClass(); $node->type = 'company'; $node->uid = 1; node_object_prepare($node);

and now I would like to get all values from form_state and put them into the node.

Many thanks!

1

There are 1 best solutions below

4
MilanG On

Hook your form, add new submit handler and place your code there.