Hello!

I am new to Drupal. So excuse me, if it is a stupid question.

Using CCK, I added 3 new fields to a 'Forum Topic':

- Continent
- Country
- Tags

When user selects 'Continent' from the drop down menu, based on his selection, we want to automatically populate 'Country' drop down menu. Suppose if user select 'Asia' in the 'Continent' drop down menu, then automatically, we want to populate country field asian country values 'India', 'China', 'Singapore'...

One way to implement it is by using Javascript. How to integrate Javascript in Drupal pages?

Any other inputs, suggesstions are greatly appreciated.

Thanks.

Comments

markhope’s picture

Not worked with either of them but there's a couple of modules that are supposed to do that. So far there doesn't seem to be a reliable way of doing it. See: http://drupal.org/node/142589

There's Content Taxonomy http://drupal.org/project/content_taxonomy and Dependent Dropdown http://drupal.org/project/dependantDropdown

dwees’s picture

I'm working on a module to allow for a wider variety of drop-downs allowed. It seems to work fine, but I'm having to directly examine the $_POST array, which I know is a bad move. I'm going to post my project in my sandbox sometime soon so that people can take a look at it and see if they can help me with this issue.

However, it allows users to define an array of values in their modules, and very, very easily add dependent drop-downs. It's not a CCK module, although someone could probably develop a CCK version of this pretty easily.

Dave

My site: http://www.unitorganizer.com/myblog

summit’s picture

Hi, interested in your progress Dave, greetings, Martijn

dwees’s picture

I had completely forgotten I had ever started doing this. I have no idea if I ever got it to work or not, I'll have to poke around sometime and see how I solved my problem.

Dave

My site: http://www.unitorganizer.com/myblog