I'd like to define two simple integer select lists to allow for a range of values in my node. I'm thinking that the most convenient way to do this would be to define the minimum as a select list, and the maximum as an activeselect list with dependency on the first.

So far, so good. But where do I actually define how the dependency works (ie. that the second menu contains only values larger than the minimum value selected)? I have this idea that it might be in the PHP code for "Allowed values", but how do I reference the field that I selected for dependency?

Comments

cburschka’s picture

I can't quite believe nobody has tried this before... is the activeselect widget only useful in combination with other modules like content_taxonomy?

allentseng’s picture

first, you need to look into this http://drupal.org/node/60090

setup first node reference fieldname to "node1", second node reference fieldname to "node2".

key for it to work is $form['node1']['nids']['#activeselect_targets'] = 'field-node2-nids';

and yes, you have to deal with node1 and node2 relationship within function activestuff_getnextlevel.