I have a custom module, and I am trying to hide a CCK fieldgroup using "#states" when a certain item is selected in a drop-down select list.
I have tried using states from within hook_form_alter(), like so:
$form['group_mygroup']['#states']['invisible'] = array(
':input[name="field_trigger[' . LANGUAGE_NONE. ']"]' => array( 'value' => 'hide' ),
);
This doesn't seem to do anything.
I have looked at changing the weight of my module as per various sites like http://proofgroup.com/blog/2008/dec/modifying_cck_fieldgroups_hook_form_alter.
but still to no avail. I can hide all the form elements within the fieldgroup using states but not the field group itself. Does anyone have any idea?