Drupal hide form items completely with states I try to hide a whole date/image/taxonomy block on my node form dependent on a checkbox.
If use the following for my title field it works perfectly. The title field is hidden/visible dependant on the test_box checked value.

function interceptor_box_listener(&amp;$form, &amp;$form_state) {
  $form['test_box'] = array(
    '#title' =&gt; t('You want to choose a title?'),
    '#type' =&gt; 'checkbox',
  );
  $states_array = array(
    'visible' =&gt; array(
      'input[name="test_box"]' =&gt; array('checked' =&gt; TRUE),
    ),
  );
  $form['title']['#states'] = $states_array;
  return $form;
}


The point is that I have more complex fields I need to toggle and I'm not able to address them correctly. If I try to adress the following fielditem, nothing happens at all.

&lt;div id="edit-field-plakat" class="field-type-image field-name-field-plakat field-widget-image-image form-wrapper"&gt;
&lt;div id="edit-field-plakat-und-0-ajax-wrapper"&gt;
&lt;div class="form-item form-type-managed-file form-item-field-plakat-und-0"&gt;
&lt;label for="edit-field-plakat-und-0"&gt;Plakat&lt;/label&gt;
&lt;div class="image-widget form-managed-file clearfix"&gt;&lt;input type="hidden" value="109" name="field_plakat[und][0][fid]"&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;


It tried the following:

$form['field_plakat[und][0][fid]']['#states'] = $states_array;


Is there any possibility to just pass an id to drupal but stay with the states system? Of course I'd be able to use plain javascript here, but I really like to stay strictly on the module side.
Find this field in $form array and set states currently to it.
I'm not sure, but maybe it is in $form['field_plakat'][LANGUAGE_NONE][0][$fid]?
It must be somewhere in this renderable $form array.