How to dynamically populate fields in node form from fields of a referenced node in Drupal 6
For a project, I have a Drupal 6 site with custom contents. The first one is the content of type A, with textfields a1, a2, ... The second one is the content of type B, with various fields开发者_运维知识库 b1, b2, ... and a arbitrary number of node references to A-type nodes. The node reference is done via an autocomplete widget. Each node ref is in a fieldgroup along with textfields b'1, b'2... I want the A-type nodes to act as templates to populate these fields, without having to submit the form.
To be more direct, I want, at the moment I select the ref to the A-type node, the fields b'1,... to be populated with the content of a1,... of the referenced node. All the fields are single lines textfields.
I've read a lot of possible solutions but I'm little lost. From what I've seen, I should use AHAH and maybe make a module. I've tried a lot of modules but none is satisfying. I'm totally new in this part of Drupal (writing modules), and I would be pleased to have any advice or direction.
Thanks!
I do not know of a module that can do this for you "out of the box". If you want to learn about module development, a good place to start is the module developers guide:
http://drupal.org/node/206753
After you've gone through the tutorial, I'd look into how you create your own content type. This tutorial will teach you about the Form API, which is what you will eventually use to create the AHAH form you need.
http://drupal.org/node/231019
Good luck!
精彩评论