API page: http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc...

In the code example used for #states", the comment does not match the code: The settings are hidden when the checkbox is not selected.

$form['email_canceled']['settings'] = array(
    '#type' => 'container',
    '#states' => array(
      // Hide the settings when the cancel notify checkbox is disabled.
      'invisible' => array(
       ':input[name="email_canceled_toggle"]' => array('checked' => FALSE),
      ),
    ),
  );
CommentFileSizeAuthor
2013-04-18_1515[1].png17.26 KBcconrad
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Project: Drupal core » Documentation
Version: 7.x-dev »
Component: documentation » API documentation files
Issue tags: +FAPI reference

Thanks! Moving to the project where the Form API reference file is located.

apaderno’s picture

Priority: Minor » Normal
Issue summary: View changes