Greetings!

Using prepopulate, how do I add a value to a node reference field?

i can't figure it out, have read the book pages regarding the module, but still no result.

/node/add/forum?edit[field_forum_node][0][nid]=11
/node/add/forum?edit[field_forum_node][0][nid][nid]=11
/node/add/forum?edit[field_forum_node][0][nid][nid]=[nid:11]

The field html looks like this:

<input type="text" name="field_forum_node[0][nid][nid]" id="edit-field-forum-node-0-nid-nid" size="60" value="" class="form-text form-autocomplete text" />

Id be grateful for all hints & help!

Comments

farald’s picture

Status: Active » Fixed

Oh, it seems that you have to add the group the field resides in (if any), like this:

/node/add/forum?edit[group_name][field_forum_node][0][nid]=11

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kenorb’s picture

Thanks.

doublejosh’s picture

This does not work is the node reference is a select list.
You'll need: edit[group_mygroup][field_myfield][nid][nid]=####