First attempt to adding states to a custom Content type // sample code
/**
 * Implementation of hook_form_FORM_ID_alter()
 */
function demo_form_sport_node_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    $form['field_winter_sports'] = array(
    '#states' =&gt; array(
        'visible' =&gt; array(   // action to take.
            ':input[name=field_season]' =&gt; array('value' =&gt; t('winter')),
        ),
    ),
);


}

i am trying to alter a form from a "sport" node type. my "sport" node type has 2 fields.


field_season List (text)    Check boxes/radio buttons
field_winter_sports List (text) Check boxes/radio buttons


there are two options in field_season, summer or winter.

if someone selects winter in field_season, i want to make field_winter_sports visible, otherwise remain hidden.

with my current code, when i select winter right now, nothing happens.
There are two things to consider:


The name of the input element is visible in the HTML output of the page, and that could not match with the ID used for that form element from the form API. That happens with form elements created with the field API too.
I created a field_season field, which allows just a value to be select (which means it is rendered with radio buttons); the input element name that appears in the HTML output, which is the one jQuery sees, is field_season[und], not field_season.

 




If I change the field to allow three choices (which means the form field is rendered as checkboxes), the input element name changes to field_season[und][1], field_season[und][2], and field_season[und][3].






When you want to tell to Drupal to alter the state of a form element when a radio buttons are used, you should not use t(), and the string to use as value in the state is not the string that appears to the users, but the value assigned to the value attribute of the &lt;input type="radio"&gt; tag. For example, for the form element added from the following code, those values are 0, 1, and 2.

$form['registration_cancellation']['user_register'] = array(
  '#type' =&gt; 'radios',
  '#title' =&gt; t('Who can register accounts?'),
  '#default_value' =&gt; variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL),
  '#options' =&gt; array(
    USER_REGISTER_ADMINISTRATORS_ONLY =&gt; t('Administrators only'),
    USER_REGISTER_VISITORS =&gt; t('Visitors'),
    USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL =&gt; t('Visitors, but administrator approval is required'),
  ),
);





Since the input element name contains und, which is the string value for the LANGUAGE_NONE constant, I suspect the input element name could change basing on the language associated with the field, even if I suspect it would always be und, for radio buttons and checkboxes.

As side note, learningxm is correct when it says that you should use `:input[name=""]' since that is what the example in the drupal_process_states() page shows.

$form['toggle_me'] = array(
  '#type' =&gt; 'checkbox',
  '#title' =&gt; t('Tick this box to type'),
);
$form['settings'] = array(
  '#type' =&gt; 'textfield',
  '#states' =&gt; array(
    // Only show this field when the 'toggle_me' checkbox is enabled.
    'visible' =&gt; array(
      ':input[name="toggle_me"]' =&gt; array('checked' =&gt; TRUE),
    ),
  ),
);


As noted by Clive, you are overriding the form element added using the field API; to change the states associated with the form element, you should just use the following code.

$form['field_winter_sports']['#states'] = array(/** Add here your states. **/);


I assume field_winter_sports is the correct form element ID.

I would also investigate using hook_field_widget_form_alter(), which is the hook thought to alter the form elements used for a field.