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

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.

avpaderno’s picture

Priority: Minor » Normal
Issue summary: View changes
quietone’s picture

Status: Active » Closed (won't fix)

This is for the Drupal 7 Form API reference. Since Drupal 7 is past end-of-life this is now a "won't fix".
Work on documentation for form elements for supported versions of Drupal is at #2486967: [meta] Move/Create Form Element Documentation and #3313535: [Meta] Improve documentation for Render and Form Elements.

avpaderno’s picture