Issue #667944: Javascript #states cannot hide fieldsets, radios, checkboxes does not fix the #states property for fieldsets.

The following code does not hide fieldsets, but it hides the textfield.

$conditions = array(
  'visible' => array( ':input[#edit-myradios]' => array('checked' => true) )
);

// radio buttons control visibility of other elements
$form['myradios'] = array(
  '#type' => 'radios',
  '#title' => '',
  '#options' => array( 'new' => t('New'), 'existing' => t('Existing') )
);

// sample textfield that shows/hides based on myradios state.
$form['mytextfield'] = array(
  '#type' => 'textfield',
  '#title' => 'My Textfield',
  '#states' => $conditions
);

$form['myfieldset'] = array(
  '#type' => 'fieldset',
  '#title' => 'My fieldset',
  '#states' => $conditions
);

Comments

cwgordon7’s picture

Status: Active » Closed (duplicate)
aspilicious’s picture

Status: Closed (duplicate) » Closed (fixed)

Other one is fixed