How to set Form API's password_confirm in/visible depending on prior select list input?
A container around the password_confirm did the trick! Fieldset works too.

$form['user_select'] = array(
  '#type' =&gt; 'select',
  '#options' =&gt; array('' =&gt; '- ' . t('None') . ' -') + _get_users_by_role('Subadministration'),
  '#required' =&gt; TRUE,
  '#description' =&gt; t('Chose account'),
);

$form['pass_wrapper'] = array(
    '#type' =&gt; 'container',
    '#states' =&gt; array(
      'invisible' =&gt; array(
        ':input[name="user_select"]' =&gt; array('value' =&gt; ''),
      ),
    ),
  );

$form['pass_wrapper']['confirm_password'] = array(
  '#type' =&gt; 'password_confirm',
  '#required' =&gt; TRUE,
  '#description' =&gt; t('Type same password in both fields'),
);