DDD v5.1 Beta is a GREAT idea-I have gone through all the various combinations for the solutions provided and apparently NOTHING seems to work for this.

*pray* ...please make this work!!

- If i use the latest and greatest files from http://drupal.org/node/106401 , I get a blank page.
- If I use the official release files, then again as per http://drupal.org/node/106401, i am able to do everything and, ofcourse, I get the famed Javascript error! :)
- The active-select module doesn't work. I mean its in a similar state as this.

I added a request to the module queue and no replies yet.

I know there was a bounty yesterday - if that is solved, can you release it for others to use? I can pledge $10. There are a lot of others who can pitch in too from the forums.

Comments

pushkar’s picture

Ok, so here is one 'bug' i think I found. I am using the standard STATE / CITY example with the following data set
- a Select List field called field_state with allowed values list set to:
100|100
200|200
300|300
400|400
600|600
700|700

I then have a Active Select List field called field_city with allowed values list set to:
148W,100
152W,100
146W,100
155W,100
158W,100
260XW,200
257T,200
E361T, 300
361, 300
N361TL,300

Allowed values lists "Active Select List"s do not accept the pipe (|). So you can't use 148W|148W,100
(borrowed from http://drupal.org/node/106401, commend #15)

In dependentDropdown.js, line 4 (the firebug catch),

	var filteredField = document.getElementById("edit-"+filteredFieldName</strong>+"-keys");

I replaced it by (temporarily)

	var filteredField = document.getElementById("edit-field-city-keys");

Notice that the value of filteredFieldName is field_city but the CSS has the element as field-city (with hyphen instead of underscore).

With this hack, I am able to save the options correctly (yay!). Of course this is specific. but may be this helps generate some interest and leads.

In addition, I think for the most part its a Javascript issue now. If someone can help write the parsing of the arrays and depdendt lists, we should be on the homestretch pretty soon.

esllou’s picture

I wish you all the luck in the world on this. Someone offered to tell me how to do it on skype....for $200!!

If anyone gets this working, bug-free for a simple country > state > town example, inside a CCK created nodeprofile, I'd be willing to put up even $50.

Anyone else want to add to this bounty.

$10 - pushkar
$50 - esllou
----
Total - $60

let's put our money where our mouth is and get this thing working. It's a royal pain in the a$$.

pushkar’s picture

http://pushkar.chipin.com/drupal-dependent-dropdown-module

Chipin please!

note: I have limited skills. This is to get the bounty rolling for the first person who solves the problems and makes the module work for drupal 5.1 and drupal 4.7 AND RELEASES THE CODE FOR EVERYONE.

You cant see my $10 because i cant pay myself through paypal. But I will add it when I pay the bounty.

paulcoghlan’s picture

OK, I'm in too for $30. Like a previous poster I am too looking for it to work inside a CCK created nodeprofile.

Come on we must have enough to get this ball rolling?!

Paul

Wim Leers’s picture

I have written working code for "dependent dropdowns" for taxonomy: vocabularies that only show up if certain other selections (in other vocabularies) have been made previously: "conditional vocabularies". It works with an unlimited hierarchy (and children inherit from all ancestors) and automatically generates the JavaScript/jQuery code. If this is what some of you are looking for, I can help you out.
Please reply if you need a demo - it's not yet a module, since it's not easy to turn into an easily manageable configuration page. It's not at all hard to configure manually though, and I'll help you through it.

B-Dot’s picture

Can you show us a demo?

pushkar’s picture

I was looking at it from a pure webforms and CCK perspective but approach using vocabularies might also be a solution.

If you can put up a link / demo tutorial, we all can see it.

Thanks much Wim!

Wim Leers’s picture

(Note that this is a temporary demo!)

http://64.40.146.141/node/27/edit

user/pass: test/test

Set status to "fixed" and see the second level of conditional vocabularies hop in. Currently working on making it a proper module.

esllou’s picture

could this be adapted to CCK and feed off a db for its values?

when I load that page, I see the dropdowns, but when I select News, they all disappear and no matter what I then select, they don't return although the area below the initial Forum: dropdown does move up and down a little as if it's trying to load something else.

Wim Leers’s picture

You seem to have found a bug :P Thanks. Note that I'm currently working on a separate module which has newer code, but it isn't ready yet so I can't apply it yet.

I do not see right away how this could be adapted for CCK. There has to be some sort of list of possible values. With CCK, there's not always such a list. With taxonomy, there is, since all terms must be inside a vocabulary. Of course, you could quite easily work around this, but there would probably a noticable performance penalty for larger sites.

Try Chipset for more playing around.

Wim Leers’s picture

You can check it again. All bugs are fixed and it's now a module, instead of some hacks at the theme level.

esllou’s picture

where is the module then? I still just see the node/edit page.

Wim Leers’s picture

That is the module: instead of it being a chunk of code at the theme leve, thus with manual, difficult to understand settings, it now has an administration page.

Don't you see anything happening depending on what you've selected in the "Forums" selectbox?

EDIT:
The goal of this module *is* to change the node edit form (or wherever taxonomy is displayed) to make the vocabularies assigned to it conditional. E.g. if you've selected the term "cars" in the root vocabulary, it would show you another vocabulary to show you all brands of cars, in which you can again make your selection. If you select boats however, you won't get another selection, but if you select "airplanes", you will first have to select the type of airplane in another vocabulary, and depending on that choice, it will show you another vocabulary.

Is it now clear what I was trying to achieve or do you need some sort of demo?

esllou’s picture

oh OK, thanks for that explanation. How would I be able to play with this? I use nodeprofile and CCK so would your module be able to enable me to have taxonomy dropdowns. Where can I get my hands dirty with this?

Wim Leers’s picture

I can send you the module. Nothing CCK-specific is supported, just use either freetagging or normal vocabularies and do NOT set them all as required (for obvious reasons). The configuration is done through a module-specific administration panel (as so many modules have).

esllou’s picture

OK, send it to me through drupal's contact form and also send a few instructions on setting it up and I'll give it a whirl.

mboc’s picture

Hi could you send me a demo of your module? have you continued your work on it?

Thnks

armand0’s picture

Wow, it look very well. does it work with AJAX? Do you already have finished the module? Could you send it to me?

Thanks

hintbw’s picture

Just subscribing to this thread

geoff_eagles’s picture

This question seems to keep coming up - I guess the examples that are given for activeselect may not be that clear? I posted this solution on another thread (124596) a little while back:

I've prepared a REALLY simple demo module which has 4 levels of linked dropdowns reading from the database. I based it on a location select because that seems to be what many people are interested in. Hope this is of help:

www.keyreels.com/drupal/locations.html

It uses Activeselect so you need to load that before you can run my demo. I've included some sample data.

Geoff

You can email me at geoff.eagles@gmail.com if you have comments

armand0’s picture

Hi, I tried with your demo, and it works me perfect when I use firefox but if I do it with the IE7 only the first dropdownlist shows the options, the other ones stay in white.

I know that it is not problem of your demo, maybe is the modules activeselect or the dependantDropdown. But, does somebody know as fixing it?

And once working, like you can use to make a conditioned search? If, with some dependantDropdown list to condition the search. Like: http://www.inkjetshops.e-optimus.com/en/cartridges_for_you

geoff_eagles’s picture

Sorry it didn't work in ie7 - I'm afraid I can't help you on that one. I only have one windows machine which is very old and I'm not keen to install anything more on it (I run Linux), I googled to see if anyone else had experienced similar problems and came up with:
http://drupal.org/node/129027
See if that helps?

Yes, a conditioned search is exactly what you can do. If you need any help on coding it just email me with your table details and I'll explain how you'd plumb it together. geoff.eagles@gmail.com

armand0’s picture

Thank you. I will send them to your mail.
I already made work with the IE (I post below the solution that I found).
But I see that this system of dependent dropdown list loads all the options when loading the page.

I have some places made with AJAX and PHP (not in Drupal) they alone load the options when the parent dropdown list changes.
Can one make this way?
Because when there are many options (for example Countries and their states) it returns the load of the page very slow.

geoff_eagles’s picture

As regards the observation that you have to load every possible option into the selects before it will work - that's NOT the case. All you need do is add #DANGEROUS_SKIP_CHECK' => TRUE to the control then you can load whatever options you choose into it whenever you want. If you don't set the skip check then it will fail drupals default validation. One reason you might choose to load every option is that if the person looking at your site has JS switched off and your selects are programmed to remain empty until the previous select populates them, then the site will not work for them, Whereas if you've pre-populated the selects with everything then at least the site is still usable by everyone, even those with JS disabled.
Geoff

armand0’s picture

Apparently I could fix that it worked with the IE changing the following line 173 (aprox) from activeselect.js

    --     var e = document.createEventObject();
   ++     var e = document.createEventObject('Microsoft.XMLHTTP');

after the change to my it is working me very well, with the firefox like with the IE. So that other they prove it

edex13’s picture

hello,
i tried the simple demo and it work. can u provide guide to implement thin in cck form?

markfoodyburton’s picture

I have faced the same, or similar problems as those listed on this page, so far in two ways. I agree that it would be nice to have an all singing, all dancing drop-down thing, but I fail to see how it's going to be easy to use, so I have constructed a couple of modules that solve my problems, and I suspect they may help other people. They may at least be a good place to start.

The two problems I have faced are these:

1. Having a number of products, each product is a cck node, each tagged with a term from a vocabulary. I wanted a CCK field that I could use to point to one of the products, but I want a "pre-selector" so that I can select what sort of product, then I want to select the actual product from a (hopefully much reduced) list.

2. In France, the post codes cover a number of towns, I want to type in the post code, and get a list of the towns. In this case, the database is quite large!

So, to solve these problems, I've built Taxonomy Search Module, and the Fixed Data Dropdown module.

I hope you all find them helpful, and feel free to send me your $'s if you feel morally obliged to do so!

(I'm cross posting this on node 124596, 134630 and 142589 as the same issues seem to be raised)

csc4’s picture

Sounds interesting - where are they?!?!

markfoodyburton’s picture

the modules are called: FixedDataDropdown and taxonomySearch

Let me know if you have any problems with them

Cheers

Mark.

ron_s’s picture

Yes it does solve dependent drop downs, but does have some inflexibility. It is an overlay for taxonomy hierarchies, which means it works great if you are planning to use a vocabulary for only one purpose. However if the same hierarchy needs to be used in many ways on one or more Content Types, there is no way to modify the field label out of the box.

For example, say I have the following vocabulary called "Colors":

  • Shades of Blue
    • Aqua
    • Royal
    • Teal
  • Shades of Red
    • Crimson
    • Scarlet
    • Pink

On my node, I want to have two select dropdowns. The first is to be titled "Hat Color" and the second is to be titled "Scarf Color".

The Hierarchical Select will only show up once on the node, and will only have the label of "Colors". My understanding is the only way this would work would be to create two separate vocabularies, one called "Hat Color" and a second called "Scarf Color". This might be fine for a limited set of data, but can be quite a problem if there are a lot of data dependencies and the need to leverage the same data set in multiple ways.

Wim Leers’s picture

It's not just an overlay for taxonomy. It's a new form element, that has an implementation for taxonomy.module, by hook_form_alter()-ing node forms. That's just one possible implementation.

The use case you describe is basically: "I want to use the same vocabulary multiple times within the same node."

This is a perfect match for content_taxonomy.module, which provides you with a CCK Taxonomy field. Using that module, you can create as many instances of the same vocabulary on the same nodetype (simply create multiple content_taxonomy fields), as you wish. And you can name each field whatever you like.

ron_s’s picture

Ah, thanks for the clarification. My confusion was due to our on-going conversation here (http://drupal.org/node/173032). I know you initially mentioned there is support for content_taxonomy, but wondered if that was possibly untrue since I wasn't having any success getting it to work.