coder1.com

  • home
  • drupal articles
  • contact
Home

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.

  1. <?php
  2. // include the content file

  • CCK
  • Drupal 6
  • Add new comment
  • Read more
Syndicate content

Poll

Have you used any NoSQL Databases?:

User login

  • Request new password

Navigation

  • Recent posts

  • home
  • drupal articles
  • contact