Hi,
I have 2 node content type. To make my example easy, I'll use Countries and States. The first node type is a list of Countries. The second node type is a list of States within a country and has a required reference to the Country Node type.
When I create the a Customer record, and reference the Country and States - which I want to have displayed as dropdown select lists, I want the user to select the Country first, and then based on the Country selected, populate the State dropdown list (without refreshing the page).
How do I do this!?
I've looked through all the CCK modules and cant find anything that does this, but I am sure someone must have done this before. If there is no module, is there an example PHP or javascript that someone can point me to?
thanks for your help!
Comments
You speak in terms of
You speak in terms of content, are you aware the is the CCK address module that provides that functionality as a "single" field?
thanks... but the
thanks... but the country/states was just my example which would be easily understood.
My actual need is for a Master Group and a Groups... I want the user to select the Master Group, and then the Group field would only be populated with the groups that belong to the Master Group.
Maybe I should go pull the Address module apart and see how it works. Any pointers would be good though.
thanks again.
Also have a look at
Also have a look at Hierarchial select module!
This sounds like...
This sounds like a job for http://drupal.org/project/conditional_fields.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
I am looking for this as well
I think what you're saying here is that each content type sets up a separate table in mySQL. I would like to know if there is a way to create a one-to-one relationship between two tables, within have the context of the node edit form. In other words, have a field that references the data from another content type, either as a drop down or an auto-complete, automatically creating a relationship between the two nodes in the classical sense of a relational database. You can create a drop down list within the context of the node when creating the field in CCK, but the list is created by the "Country" node, which then automatically pulls out the "States' node. It seems as though Hierarchical Select pulls in Taxonomy, but not nodes.
It seems that there should be a way to do a custom module to do this, but it would be good to know if there was a contributed module that did this (I don't think it is in the core).
Anybody know if this is possible via contributed module?
Node Reference
That's not really the topic of the original post. But I think if you look into the "Node Reference" CCK field you will find what you are looking for.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com