Hi,

Im trying to set up drupal so that when ppl post a story they get the option to select a continent from a dropdown list, and then another one with countries, depending on the option they selected in the continent list.

example:
user selects Europe in the Continent list - > the country list will display all european countries.

Is this possible?

Comments

vm’s picture

investigate the activeselect.module or the dependantdropdown.module. The latter may be easier to implement if you have no coding skills.

modano’s picture

thanks!

PRFB’s picture

There's an extensive tutorial on how to do this in a very cool but somewhat complicated way at: http://blue.live4all.co.il/~mooffie/cms/node/15

The author also has a quick overview of other ways to do it that might be helpful to you:

ActiveSelect: Since with ActiveSelect all items (100,000 cities) are initially loaded into the form —thus included in the page— this solution does not satisfy our first requirement —that of dataset size. And since a SELECT form element containing 100,100 items, when no adequate Javascript support's present, is far from being "graceful", this solution does not satisfy our second requirement either.

dependentDropdown: This solution not only fails both our requirements, but the module also invents new types of inadequacies. No doubt here: the author of this module should be executed.

The Ubercart example: This link magically pops up whenever a discussion on "dynamic" forms takes place. I put this link here for the sake of conformity — and to save commentators to this tutorial the typing. This "ubercart" "solution" has nothing to do with the subject of this tutorial.

FixedDataDropdown (new!) I gave this module only a cursory look —which revealed no Javascript degradability. After reading the list above you may have come to the sensible conclusion that this is the only viable alternative to "our" solution. Indeed, if you don't require Javascript degradability, by all means give it a try.