Trouble with form api I got a problem to toggle the textfield if the ckeckbox with value 1 is checked.

function gkform_nameform() {
 $form['check'] = array
    (
    '#type'            =&gt; 'checkboxes', 
    '#options'         =&gt; array
      (
      1 =&gt; 'Sometext',
      2 =&gt; 'Sometext2',
      ),
    );
$form['user_name'] = array(
'#type'=&gt;'textfield',
'#states'=&gt;array(
    'visible'=&gt;array(
    ':input[name="check"]'=&gt;array('checked'=&gt; 'options' =&gt; '1' == TRUE),
    ),
  ),
 );

$form['submit'] = array(
'#type' =&gt; 'submit',
'#value' =&gt; t('Download')
);
return $form;
}
The Form API gives checkboxes names that include their options key. So your :input needs to be slightly adjusted to

':input[name="check[1]"]' =&gt; array('checked' =&gt; TRUE),