Drupal Nodereference in a custom form - drupal

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?

Starting learning ahah here: 'add another item' in non-CCK Drupal forms
Someone who try investigate this: http://drupal.org/node/266584#comment-870376

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

Related

Adding fields acting like tags

I am working on news website and I would like to add two fields in the post form, one for the reporters names and other for photographers names.
I need these fields to be act exactly like tags field: you can add many and it is autocomplete.
I am not sure what is the proper way to implement such thing? and whether there Is a plugin for that or not?
Many thanks
you can create your own category/tag by using below plugin
1. Custom Post Types and Custom Fields creator – WCK
OR
2. Toolset Types – Custom Post Types, Custom Fields and Taxonomies

CCK create custom non-standard field

I've created new content type. And I want add new custom non-standard field. The field should consist of two text fields. Let's say: double text field. Ex.: Product content type and I want to add features of product such as: weight, length etc(many features). First field is 'Feature' and the second one is 'Value of feature'. The question is: How I can realize such a field? Module, hooks?
You can create your own field pretty easily, you'll need a custom module and to implement a bunch of hooks like you suggest.
Rather than go through all of those here you'd be better off downloading the Examples module, and looking at field_example. I've based tons of custom fields off of that code and they've all worked perfectly. Plus the module is well commented and gives you good insight in to the way the field/widget systems work.
Hope that helps
One straightforward alternative is to use the Field Collection module

drupal translate module issue, assign custom fields to autotranslate

Drupal:Can I assign custom fields to autotranslate them when I create a new article?
By default it creates and translates the Title and Body field, but I have several more depending on the content types. (This is set on actions)
I didn't quite know how to add more fields to translate
I am not exactly sure what those other fields are. Would the be something that is created using CCK or views?
Drupal uses the function t(...) to translate strings, if you want that functionality you need to wrap your text in that.
More info about t() and how it works. (Drupal 6)
More info about the Localization API (PDF cheat sheet)
UPDATE
Just found a link to what might be more suitable for your needs:
Drupal.org > Translating Content in Drupal

What's meaning of '#programmed' attribute of a form array in drupal?

What's meaning of '#programmed' attribute of a form array in drupal?
I didn't find any documentation for it in drupal.org
Drupal allows you to submit forms from a programmatically, which can be really useful for making comments/nodes etc from a custom module. '#programmed' is set to true when a form is submitted by a function using drupal_execute. see more here: http://api.drupal.org/api/function/drupal_execute/6

How do I put a custom version of node/add form in a view using customfield in drupal 6?

I'm trying to add a pre-filled 'add reply' form to a view of nodes. Reply is a content-type (reply) with certain fields that need to be prefilled based on what is in the view. This way a user can see only the selected fields from the node/add/reply.
At the moment I'm building the forms manually - copy the form from node/add, do some modifications using php & views customfield, but I would like to be able to just push default values to some fields and hide some others and then make drupal render it with all the javascript glory like date select etc.
Can this be done?
How about using Form Block to place the node add form on a page in a block below a view.
About conditional defaults... I guess javascript.

Resources