Drupal 6
Adding a CCK Field to a Custom Form
Mike Milano — October 8, 2010 - 1:19am
Recently I wanted to add a CCK combo field into a custom form. Why would you need to do this? Well, my reason was to re-use a combo field with the 'add another item' functionality. Using the node form was not an option.
In this example we have a CCK combo field named "guests". Each guest has a first name, last name, and email address. The content type the guests field is in is my_event.
When adding this code to your form function, the guests field will display just as it does on the node form.
<?php // include the content file
