In my custom module i use #states to show a text field when boolean field value is 1.

I can not use #states with a taxonomy field

My code:

WORK

function my_module_form_alter (&$form, &$form_state, $form_id) {
     $form['field_my_text']['#states'] = array(
          'visible' => array(
               ':input[name="field_my_boolean[und]"]' => array ('value') => 1),
               ),
          );
}

.
.
DON'T WORK

function my_module_form_alter (&$form, &$form_state, $form_id) {
     $form['field_my_text']['#states'] = array(
          'visible' => array(
               ':input[name="field_my_taxonomy[und]"]' => array ('value') => 15),
               ),
          );
}

I tried:
('value') => 'my_term_name')
('tid') => '15'
but don't work

Comments

Mirkozzo’s picture

The problem is shs module.

how can I use #states with shs widget?