Using #states visible
Here is some example code. Maybe your selector is incorrect?

$form['main']['elem1'] = array(
  '#type' =&gt; 'select',
  '#title' =&gt; t('1'),
  '#options' =&gt; drupal_map_assoc(array('A', 'B')),
);
$form['main']['elem2'] = array(
  '#type' =&gt; 'select',
  '#title' =&gt; t('2'),
  '#options' =&gt; drupal_map_assoc(array('A', 'B')),
);

$form['main']['elem3'] = array(
  '#type' =&gt; 'textfield',
  '#value' =&gt; t('3'),
  '#states' =&gt; array(
    'visible' =&gt; array(
      'xor',
      array(':input[name="elem1"]' =&gt; array('value' =&gt; 'A')),
      // XOR.
      array(':input[name="elem2"]' =&gt; array('value' =&gt; 'A')),
    ),
  ),
);
$form['main']['elem4'] = array(
  '#type' =&gt; 'textfield',
  '#value' =&gt; t('4'),
);
$form['main']['elem5'] = array(
  '#type' =&gt; 'textfield',
  '#value' =&gt; t('5'),
  '#states' =&gt; array(
    'visible' =&gt; array(
      ':input[name="elem1"]' =&gt; array('value' =&gt; 'A'),
      ':input[name="elem2"]' =&gt; array('value' =&gt; 'A'),
    ),
  ),
);


And then the alter function.

function module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'af_aam_aam_form') {
    $form['main']['elem4']['#states'] = array(
      'visible' =&gt; array(
        array(':input[name="elem1"]' =&gt; array('value' =&gt; 'A')),
        // OR.
        array(':input[name="elem2"]' =&gt; array('value' =&gt; 'A')),
      ),
    );
  }
}