I'm trying to have custom numbers of selections based on role in my custom form. I thought this was possible using the 'dropbox_limit' attribute, but I can't figure out how to set this limit in my template.
I'm using Drupal 5.7

Here is the code that I've tried:

// Following the form array:
$form['1']['1']['#hierarchical_select_settings'] = array('dropbox_limit'=>2);

$taxonomy['2']['#hierarchical_select_settings'] = array('dropbox_limit' => 2);
$form['#hierarchical_select_settings'] = array('dropbox_limit' => 2);
$form['1']['#hierarchical_select_settings'] = array('dropbox_limit' => 2);
$form['taxonomy']['#hierarchical_select_settings'] = array('dropbox_limit' => 2);

// And to add the taxonomy select (which displays... just not with my set limit)
<?php print '<div id="txnmy">' .drupal_render($form['taxonomy']) .'</div>';  ?>

I've tried all of the ways above and can't set a custom limit. Is there another way I should go about this? or have I not found the right path to the dropbox_limit attribute? Any help would be appreciated.

Comments

wim leers’s picture

Status: Active » Fixed

Uhm… just do a print_r() of $form and find your way to the element? It depends on your vocabulary id. E.g. for vid == 3, it'll probably be something like $form['taxonomy'][3].

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.