Jump to:
| Project: | Content Construction Kit (CCK) |
| Version: | 6.x-2.6 |
| Component: | General |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Good day. I could not find an answer to the question.
There is a type of material 1 with the field field_customer type of text (a string with multiple unique content)
and field field_customer_resellers as the text (a simple string with multiple values, such reseller1, reseller2, reseller3).
Here I do not know how to make the values unique. is actually the first question.
Second question:
is the type of material 2 with CCK field type list field_thisnodetype_customer. here must display a list of valid values of the field
necessary, given that both the first and second material created by the same user, give this field the user multiple choice values of the first type of material (field field_customer) and conform to a field field_thisnodetype_customer_diller list of field values field_customer_resellers.
Here, consistency is lost between the binding of several field values reseller for one customer, but I think you understand what I am talking about. Please, help in what direction to proceed
Comments
#1
1) You'll probably need to implement a validation routine to make sure users cannot generate dups. You can do so using #element_validate or #validate callbacks from your own implementation of hook_form_alter(), or implement hook_nodeapi('validate'). You may also wish to try adding some kind of validation client-side adding your own behavior to the node edit form.
2) You can use PHP code to generate the list of allowed values. If that does not cover your needs, because you need something on the node being edited for context to derive allowed values, then you'll have to find a way to inject your own list starting from hook_form_alter(), then add an #after_built callback to the field element. You can then derive allowed values list based on anything else available when the node form is being processed, and you may also need to add some kind of client-side behavior to rebuild this list based on data edited by the user on the node edit form.
There is more than one way to do it. So the above are just ideas. You'll need to explore and/or refine them yourself. CCK does not provide this kind of features, so this needs coding and investigation.
#2
Automatically closed -- issue fixed for 2 weeks with no activity.
#3
subj don't realized
i have new reason to talk about this issue.
maybe you can provide any example of php code, today created new post here http://drupal.org/node/505612
a can't write some php code for a 3rd field in last post