4
votes

I have a custom Drupal FAPI form that supports a fairly complex workflow and I would like to add a Nodereference field to it. Although I've found people who have included Nodereference fields on custom forms, I have been unable to find any examples of the FAPI declaration for the field (other than this question which uses a text field with the Nodereference AHAH callback: Is it possible to customise drupal node reference and pass your search and a argument from another field).

So: what is the best way to add a Nodereference field to a custom form (FAPI)?

Bonus question: is there a simple way to allow for multiple values like CCK supports in a node form? Multivalue Nodereference Field in CCK Node

2
As an additional note: I'm not worried about trying to create nodes in-line. We can assume that any nodes I want to reference have already been created.JavadocMD

2 Answers

2
votes
0
votes

You can go to check the article: Adding dynamic form elements using AHAH http://drupal.org/node/331941