States visibility in type select and radio in drupal 7 I have a custom form  

$form['basic']['legal_form'] = array(
  '#type' =&gt; 'select',
  '#options' =&gt; array(
    'option1' =&gt; 'option1',
    'option2' =&gt; 'option2',
    'option3' =&gt; 'option3',
  ),
  '#title' =&gt; 'My Dropdown',
);
//radio button to show if selected option3
$form['basic']['bearer_shares'] = array(
  '#type' =&gt; 'radios',
  '#title' =&gt; 'Radio Button to show',
  '#options' =&gt; array(1 =&gt; t('yes'), 2 =&gt; t('no')),
  '#states' =&gt; array(
    'visible' =&gt; array(
    ':input[name="legal_form"]' =&gt; array('value' =&gt; 'option3'),
    ),
  ),
);


I try too

':input[name="legal_form"]' =&gt; array('selected' =&gt; 'option3'),


If I change type to textfield it works as expected but not when I try to use radio. Can anyone suggest me what I am doing wrong.
Try this code

$form['basic']['legal_form'] = array(
  '#type' =&gt; 'select',
  '#options' =&gt; array(
    'option1' =&gt; 'option1',
    'option2' =&gt; 'option2',
    'option3' =&gt; 'option3',
  ),
  '#title' =&gt; 'My Dropdown',
  '#attributes' =&gt; array('id' =&gt; 'selection_id'),
);

//radio button to show if selected option3
$form['basic']['bearer_shares'] = array(
  '#type' =&gt; 'radios',
  '#title' =&gt; 'Radio Button to show',
  '#options' =&gt; array(1 =&gt; t('yes'), 2 =&gt; t('no')),
  '#states'           =&gt; array( 
    'visible' =&gt; array(
      'select[id="selection_id"]' =&gt; array('value' =&gt; 'option3')
    )
  )
);